﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
  xmlns:controlsPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
  xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:dataForm="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
  xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
  xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
  xmlns:inputToolkitPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Input.Toolkit"
  xmlns:layoutPrimitivesToolkit="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Layout.Toolkit"
  xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
  xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
  xmlns:basics="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
  xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input"
  xmlns:dataPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
  xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
  xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
  xmlns:chartingPrimitivesToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"
  xmlns:themingToolkit="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.Toolkit"
  xmlns:systemColors="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.SystemColors">

  <!-- Global Settings-->
  <systemColors:SystemBrushes x:Key="SystemBrushes"/>
  <sys:String x:Key="FontF_Bold">Segoe UI Semibold, Lucida Sans Unicode</sys:String>
  <sys:String x:Key="FontF_Normal">Segoe UI, Lucida Sans Unicode</sys:String>
  <sys:Double x:Key="FontS">13</sys:Double>
  <sys:Double x:Key="FontS_Small">12</sys:Double>
  <sys:Double x:Key="FontS_Big">14</sys:Double>

  <!-- Theme -->
  <Style TargetType="themingToolkit:Theme">
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper>
          <systemColors:SetterValueBindingHelper
            Property="Background"
            Binding="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" />
          <systemColors:SetterValueBindingHelper
            Property="Foreground"
            Binding="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" />
        </systemColors:SetterValueBindingHelper>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="systemColors:SystemColorsTheme">
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper>
          <systemColors:SetterValueBindingHelper
            Property="Background"
            Binding="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" />
          <systemColors:SetterValueBindingHelper
            Property="Foreground"
            Binding="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" />
        </systemColors:SetterValueBindingHelper>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- *******CONTROLS STYLES****** -->
  <!-- **************************** -->

  <!-- TextBlock Style-->
  <Style TargetType="TextBlock">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="Foreground"
            Binding="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
  </Style>

  <!--Button Style-->
  <Style TargetType="Button">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Grid Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" Margin="-2" Opacity="0" IsHitTestVisible="false" RadiusX="2" RadiusY="2"/>
            <Border x:Name="Background" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2">
              <Border x:Name="ColorChange" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
            </Border>
            <ContentControl x:Name="contentControl" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,3"/>
            </ContentControl>
            <Rectangle x:Name="DisabledVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0" RadiusX="2"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--RepeatButton Style-->
  <Style TargetType="RepeatButton">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="RepeatButton">
          <Grid Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" Margin="-2" Opacity="0" IsHitTestVisible="false" RadiusX="2" RadiusY="2"/>
            <Border x:Name="Background" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2">
              <Border x:Name="ColorChange" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
            </Border>
            <ContentControl x:Name="contentControl" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,3"/>
            </ContentControl>
            <Rectangle x:Name="DisabledVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0" RadiusX="2" RadiusY="2"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--ToggleButton Style-->
  <Style TargetType="ToggleButton">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ToggleButton">
          <Grid Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CheckStates">
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundChecked"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentControlChecked" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="contentControl">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" Margin="-2" Opacity="0" IsHitTestVisible="false" RadiusX="2" RadiusY="2"/>
            <Border x:Name="Background" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2"/>
            <Border x:Name="BackgroundChecked" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Opacity="0" CornerRadius="2"/>
            <Border x:Name="ColorChange" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Opacity="0"/>
            <ContentControl x:Name="contentControl" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,3"/>
            </ContentControl>
            <ContentControl x:Name="contentControlChecked" TextOptions.TextHintingMode="Fixed" Foreground="{Binding HighlightTextBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
              <ContentPresenter x:Name="contentPresenterChecked" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,3"/>
            </ContentControl>
            <Rectangle x:Name="DisabledVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0" RadiusX="2" RadiusY="2"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--Validation Tooltip Style-->
  <ControlTemplate x:Key="ValidationToolTipTemplate">
    <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0" TextOptions.TextHintingMode="Fixed">
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="OpenStates">
          <VisualStateGroup.Transitions>
            <VisualTransition GeneratedDuration="0"/>
            <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
              <Storyboard>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                  <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                  <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualTransition>
          </VisualStateGroup.Transitions>
          <VisualState x:Name="Closed">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Open">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <Grid.RenderTransform>
        <TranslateTransform x:Name="xform" X="-25"/>
      </Grid.RenderTransform>
      <Border Margin="4,4,-4,-4" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".05" CornerRadius="5"/>
      <Border Margin="3,3,-3,-3" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".06" CornerRadius="4"/>
      <Border Margin="2,2,-2,-2" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".07" CornerRadius="3"/>
      <Border Margin="1,1,-1,-1" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".08" CornerRadius="2"/>
      <Border Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}"/>
      <Border>
        <TextBlock Text="{Binding (Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap" Foreground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" FontFamily="{StaticResource FontF_Normal}" FontSize="{StaticResource FontS}" Margin="8,4,8,4" MaxWidth="250" UseLayoutRounding="false"/>
      </Border>
    </Grid>
  </ControlTemplate>

  <!--CheckBox Style-->
  <Style TargetType="CheckBox">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="CheckBox">
          <Grid Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".3"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0.55"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CheckStates">
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked"/>
                <VisualState x:Name="Indeterminate">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="20"/>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid x:Name="CheckboxGrid" HorizontalAlignment="Left" VerticalAlignment="Center">
              <Rectangle x:Name="ContentFocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" Height="20" Width="20" IsHitTestVisible="false" Opacity="0" Margin="-1" RadiusX="2" RadiusY="2"/>
              <Rectangle x:Name="Background" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Height="16" Width="16" Margin="1" RadiusX="2" RadiusY="2"/>
              <Path x:Name="CheckIcon" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="11" Margin="1,1,0,1.5" Width="11.5" Opacity="0" Data="M102.03442,598.79645 L105.22962,597.78918 L106.78825,600.42358 C106.78825,600.42358 108.51028,595.74304 110.21724,593.60419 C112.00967,591.35822 114.89314,591.42316 114.89314,591.42316 C114.89314,591.42316 112.67844,593.42645 111.93174,594.44464 C110.7449,596.06293 107.15683,604.13837 107.15683,604.13837 z"/>
              <Rectangle x:Name="IndeterminateIcon" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Height="2" Width="6" HorizontalAlignment="Center" Opacity="0"/>
              <Border x:Name="Hover" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Height="16" Width="16" Margin="1" Opacity="0"/>
              <Border x:Name="ValidationErrorElement" Margin="0" Visibility="Collapsed" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                <ToolTipService.ToolTip>
                  <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                    <ToolTip.Triggers>
                      <EventTrigger RoutedEvent="Canvas.Loaded">
                        <BeginStoryboard>
                          <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                  <sys:Boolean>true</sys:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </BeginStoryboard>
                      </EventTrigger>
                    </ToolTip.Triggers>
                  </ToolTip>
                </ToolTipService.ToolTip>
              </Border>
              <Rectangle x:Name="DisabledVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Height="16" Width="16" Opacity="0" RadiusX="2"/>
            </Grid>
            <ContentControl Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1" Margin="3,0,0,0">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </ContentControl>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--RadioButton Style-->
  <Style TargetType="RadioButton">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="RadioButton">
          <Grid Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="20"/>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0.55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CheckStates">
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
              <Ellipse x:Name="ContentFocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" Height="20" Width="20" Opacity="0" Margin="-4" IsHitTestVisible="false"/>
              <Ellipse x:Name="Background" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Height="16" Width="16" Margin="1"/>
              <Ellipse x:Name="CheckIcon" UseLayoutRounding="False" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Height="5" Width="5" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0"/>
              <Border x:Name="Hover" Height="16" Width="16" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="100" Margin="1" Opacity="0"/>
              <Grid x:Name="ValidationErrorElement" Visibility="Collapsed" ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                <ToolTipService.ToolTip>
                  <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                    <ToolTip.Triggers>
                      <EventTrigger RoutedEvent="Canvas.Loaded">
                        <BeginStoryboard>
                          <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                  <sys:Boolean>true</sys:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </BeginStoryboard>
                      </EventTrigger>
                    </ToolTip.Triggers>
                  </ToolTip>
                </ToolTipService.ToolTip>
                <Ellipse Stroke="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" Margin="0"/>
              </Grid>
              <Ellipse x:Name="DisabledVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Height="16" Width="16" Opacity="0"/>
            </Grid>
            <ContentControl Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1" Margin="3,0,0,0">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </ContentControl>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ScrollBar Style -->
  <Style TargetType="ScrollBar">
    <Setter Property="MinWidth" Value="20"/>
    <Setter Property="MinHeight" Value="20"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ScrollBar">
          <Grid x:Name="Root">
            <Grid.Resources>
              <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                <Grid x:Name="Root" Background="Transparent">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                <Grid x:Name="Root" Cursor="Hand" Background="#01000000">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="8" Width="4" Stretch="Uniform" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z"/>
                  <Path x:Name="Highlight" Fill="{Binding ControlTextBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="8" Width="4" Stretch="Uniform" Opacity="0" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z"/>
                  <Path x:Name="DisabledElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="8" Width="4" Stretch="Uniform" Opacity="0" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z"/>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                <Grid x:Name="Root" Cursor="Hand" Background="#01000000">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="8" Width="4" Stretch="Uniform" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z"/>
                  <Path x:Name="Highlight" Fill="{Binding ControlTextBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="8" Width="4" Stretch="Uniform" Opacity="0" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z"/>
                  <Path x:Name="DisabledElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="8" Width="4" Stretch="Uniform" Opacity="0" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z"/>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                <Grid x:Name="Root" Cursor="Hand" Background="#01000000">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0:0:0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="4" Width="8" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z"/>
                  <Path x:Name="Highlight" Fill="{Binding ControlTextBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="4" Width="8" Stretch="Uniform" Opacity="0" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z"/>
                  <Path x:Name="DisabledElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="4" Width="8" Stretch="Uniform" Opacity="0" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z"/>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                <Grid x:Name="Root" Cursor="Hand" Background="#01000000">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0:0:0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="4" Width="8" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z"/>
                  <Path x:Name="Highlight" Fill="{Binding ControlTextBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="4" Width="8" Stretch="Uniform" Opacity="0" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z"/>
                  <Path x:Name="DisabledElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" Height="4" Width="8" Stretch="Uniform" Opacity="0" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z"/>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                <Grid>
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Grid x:Name="ThumbVisual" Margin="0" Cursor="Hand">
                    <Rectangle x:Name="Background" Fill="{Binding ButtonGradient_Horizontal, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" RadiusX="8" RadiusY="8" Margin="1,0"/>
                    <Rectangle x:Name="ColorChange" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" RadiusX="8" RadiusY="8" Opacity="0" Margin="1,0"/>
                  </Grid>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                <Grid>
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Grid x:Name="ThumbVisual" Margin="0" Cursor="Hand">
                    <Rectangle x:Name="Background" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" RadiusX="8" RadiusY="8" Margin="0,1"/>
                    <Rectangle x:Name="ColorChange" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" RadiusX="8" RadiusY="8" Opacity="0" Margin="0,1"/>
                  </Grid>
                </Grid>
              </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="HorizontalRoot" Margin="1">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <Border Grid.ColumnSpan="5" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlLightLight, Source={StaticResource SystemBrushes}}" BorderThickness="0,1,0,0" Margin="0,-1,0,0"/>
              <Border Grid.ColumnSpan="3" Grid.Column="1" Background="{Binding ControlLightLightBrush, Source={StaticResource SystemBrushes}}" CornerRadius="8" Margin="0,1,0,1" Opacity=".5"/>
              <RepeatButton x:Name="HorizontalSmallDecrease" Grid.Column="0" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" Width="18" Interval="50" IsTabStop="False" Template="{StaticResource HorizontalDecrementTemplate}"/>
              <RepeatButton x:Name="HorizontalLargeDecrease" Grid.Column="1" Width="0" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}"/>
              <Thumb x:Name="HorizontalThumb" Grid.Column="2" MinWidth="18" Width="18" Template="{StaticResource HorizontalThumbTemplate}"/>
              <RepeatButton x:Name="HorizontalLargeIncrease" Grid.Column="3" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}"/>
              <RepeatButton x:Name="HorizontalSmallIncrease" Grid.Column="4" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" Width="18" Interval="50" IsTabStop="False" Template="{StaticResource HorizontalIncrementTemplate}"/>
            </Grid>
            <Grid x:Name="VerticalRoot" Visibility="Collapsed" Margin="1">
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <Border Grid.RowSpan="5" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlLightLight, Source={StaticResource SystemBrushes}}" BorderThickness="1,0,0,0" Margin="-1,0,0,0"/>
              <Border Grid.RowSpan="3" Grid.Row="1" Background="{Binding ControlLightLightBrush, Source={StaticResource SystemBrushes}}" CornerRadius="8" Margin="1,0,1,0" Opacity=".5"/>
              <RepeatButton x:Name="VerticalSmallDecrease" Grid.Row="0" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" Height="18" Interval="50" IsTabStop="False" Template="{StaticResource VerticalDecrementTemplate}"/>
              <RepeatButton x:Name="VerticalLargeDecrease" Grid.Row="1" Height="0" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}"/>
              <Thumb x:Name="VerticalThumb" Grid.Row="2" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" Height="18" MinHeight="18" Template="{StaticResource VerticalThumbTemplate}"/>
              <RepeatButton x:Name="VerticalLargeIncrease" Grid.Row="3" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}"/>
              <RepeatButton x:Name="VerticalSmallIncrease" Grid.Row="4" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" Height="18" Interval="50" IsTabStop="False" Template="{StaticResource VerticalIncrementTemplate}"/>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ScrollViewer Style -->
  <Style TargetType="ScrollViewer">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="Padding" Value="8,6,8,6"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ScrollViewer">
          <Border BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" TextOptions.TextHintingMode="Fixed">
            <Grid Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" Margin="{TemplateBinding Padding}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
              <Rectangle Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Grid.Column="1" Grid.Row="1"/>
              <ScrollBar x:Name="VerticalScrollBar" Margin="0,-1,-1,-1" Width="18" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" IsTabStop="False" Grid.Column="1" Grid.Row="0" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{TemplateBinding VerticalOffset}"/>
              <ScrollBar x:Name="HorizontalScrollBar" Height="18" Margin="-1,0,-1,-1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" IsTabStop="False" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{TemplateBinding HorizontalOffset}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--ListBoxItemStyle-->
  <!--*********************************************-->
  <!-- If you use a custom content layout/template -->
  <!-- you will need to tweak the selected and -->
  <!-- mouseover states to ensure colors are -->
  <!-- updated properly-->
  <!--*************************************-->
  <Style TargetType="ListBoxItem">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Padding" Value="3"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="TabNavigation" Value="Local"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Grid Background="{TemplateBinding Background}" Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverColor" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".15"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard/>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SelectionStates">
                <VisualState x:Name="Unselected"/>
                <VisualState x:Name="Selected">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SelectedColor" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".3"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="SelectedColor" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
            <Rectangle x:Name="HoverColor" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
            <ContentControl x:Name="Content_Main" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="Center">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </ContentControl>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" Visibility="Collapsed"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--ListBox Style-->
  <Style TargetType="ListBox">
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="1"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="TabNavigation" Value="Once"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBox">
          <Grid TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}" BorderThickness="{TemplateBinding BorderThickness}" TabNavigation="{TemplateBinding TabNavigation}">
              <ItemsPresenter/>
            </ScrollViewer>
            <Border x:Name="ValidationErrorElement" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Margin="-1" BorderThickness="2"  Visibility="Collapsed">
              <ToolTipService.ToolTip>
                <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                  <ToolTip.Triggers>
                    <EventTrigger RoutedEvent="Canvas.Loaded">
                      <BeginStoryboard>
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                            <DiscreteObjectKeyFrame KeyTime="0">
                              <DiscreteObjectKeyFrame.Value>
                                <sys:Boolean>true</sys:Boolean>
                              </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </BeginStoryboard>
                    </EventTrigger>
                  </ToolTip.Triggers>
                </ToolTip>
              </ToolTipService.ToolTip>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--ComboBoxItem Style-->
  <Style TargetType="ComboBoxItem">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Padding" Value="3"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="TabNavigation" Value="Local"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ComboBoxItem">
          <Grid Background="{TemplateBinding Background}" Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverColor" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".15"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard/>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SelectionStates">
                <VisualState x:Name="Unselected"/>
                <VisualState x:Name="Selected">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SelectedColor" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".3"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="SelectedColor" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
            <Rectangle x:Name="HoverColor" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
            <ContentControl x:Name="Content_Main" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="Center">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </ContentControl>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" Visibility="Collapsed"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--ComboBoxStyle-->
  <Style TargetType="ComboBox">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Padding" Value="7,2,25,2"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="TabNavigation" Value="Once"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ComboBox">
          <Grid Cursor="Hand">
            <Grid.Resources>
              <Style x:Name="comboToggleStyle" TargetType="ToggleButton">
                <Setter Property="Template">
                  <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                      <Grid>
                        <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                                  <SplineDoubleKeyFrame KeyTime="0" Value=".20"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Pressed">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                                  <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled"/>
                          </VisualStateGroup>
                          <VisualStateGroup x:Name="CheckStates">
                            <VisualState x:Name="Checked">
                              <Storyboard>
                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BackgroundChecked"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Unchecked"/>
                            <VisualState x:Name="Indeterminate"/>
                          </VisualStateGroup>
                          <VisualStateGroup x:Name="FocusStates">
                            <VisualState x:Name="Focused"/>
                            <VisualState x:Name="Unfocused"/>
                          </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2"/>
                        <Border x:Name="BackgroundChecked" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Opacity="0" CornerRadius="2"/>
                        <Border x:Name="ColorChange" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Opacity="0"/>
                        <ContentControl x:Name="contentControl" FontFamily="WebDings" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,-4,-1">
                          <ContentPresenter x:Name="contentPresenter" Content=" " ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,3"/>
                        </ContentControl>
                        <Path x:Name="Arrow" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Uniform" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z" UseLayoutRounding="False" RenderTransformOrigin="0.5,0.5" Margin="0,0,12,-1" Width="5" Height="9" HorizontalAlignment="Right" VerticalAlignment="Center">
                          <Path.RenderTransform>    
                            <TransformGroup>
                              <ScaleTransform/>
                              <SkewTransform/>
                              <RotateTransform Angle="90"/>
                              <TranslateTransform/>
                            </TransformGroup>
                          </Path.RenderTransform>
                        </Path>
                      </Grid>
                    </ControlTemplate>
                  </Setter.Value>
                </Setter>
              </Style>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
                <VisualState x:Name="FocusedDropDown">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="ContentPresenterBorder">
              <Grid>
                <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" Margin="-2" IsHitTestVisible="false" Opacity="0" RadiusX="2" RadiusY="2"/>
                <ToggleButton x:Name="DropDownToggle" Content="6" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Right" Style="{StaticResource comboToggleStyle}" VerticalContentAlignment="Stretch" Padding="3,1"/>
                <ContentControl TextOptions.TextHintingMode="Fixed" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
                  <ContentPresenter x:Name="ContentPresenter"/>
                </ContentControl>
              </Grid>
            </Border>
            <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" Margin="-1">
              <ToolTipService.ToolTip>
                <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                  <ToolTip.Triggers>
                    <EventTrigger RoutedEvent="Canvas.Loaded">
                      <BeginStoryboard>
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                            <DiscreteObjectKeyFrame KeyTime="0">
                              <DiscreteObjectKeyFrame.Value>
                                <sys:Boolean>true</sys:Boolean>
                              </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </BeginStoryboard>
                    </EventTrigger>
                  </ToolTip.Triggers>
                </ToolTip>
              </ToolTipService.ToolTip>
            </Border>
            <Rectangle x:Name="DisabledVisualElement" RadiusX="2" RadiusY="2" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
            <Popup x:Name="Popup">
              <Border x:Name="PopupBorder" CornerRadius="2,2,0,0" HorizontalAlignment="Stretch" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}">
                <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Padding="1">
                  <ItemsPresenter/>
                </ScrollViewer>
              </Border>
            </Popup>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--Thumb Style-->
  <Style TargetType="Thumb">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Thumb">
          <Grid Cursor="Hand">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" RadiusX="100" RadiusY="100" Margin="-2" Opacity="0" IsHitTestVisible="false"/>
            <Border x:Name="Background" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="100">
              <Border x:Name="ColorChange" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0" CornerRadius="100"/>
            </Border>
            <Rectangle x:Name="DisabledVisualElement" Fill="{Binding ControlLightLightBrush, Source={StaticResource SystemBrushes}}" RadiusX="100" RadiusY="100" IsHitTestVisible="false" Opacity="0"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--Slider Style-->
  <Style TargetType="Slider">
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Maximum" Value="10"/>
    <Setter Property="Minimum" Value="0"/>
    <Setter Property="Value" Value="0"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Slider">
          <Grid x:Name="Root">
            <Grid.Resources>
              <ControlTemplate x:Key="RepeatButtonTemplate">
                <Grid x:Name="Root" Opacity="0" Background="Transparent"/>
              </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HorizontalTrackRectangleDisabledOverlay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ThumbDisabledOverlay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="VerticalTrackRectangleDisabledOverlay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="HorizontalTemplate" Background="{TemplateBinding Background}">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Rectangle x:Name="TrackRectangle" Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Height="3" Margin="5,0,5,0" Grid.Column="0" Grid.ColumnSpan="3"/>
              <Rectangle x:Name="HorizontalTrackRectangleDisabledOverlay" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Height="3" Margin="5,0,5,0" Opacity=".55" Visibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="3"/>
              <RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Height="22" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="0"/>
              <Thumb x:Name="HorizontalThumb" Height="16" Width="16" IsTabStop="True" Grid.Column="1"/>
              <Rectangle x:Name="ThumbDisabledOverlay" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" RadiusX="2" RadiusY="2" Width="11" Opacity=".55" Visibility="Collapsed" Grid.Column="1"/>
              <RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Height="22" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="2"/>
            </Grid>
            <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Background="{TemplateBinding Background}">
              <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <Rectangle Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Margin="0,5,0,5" Width="3" Grid.Row="0" Grid.RowSpan="3"/>
              <Rectangle x:Name="VerticalTrackRectangleDisabledOverlay" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Margin="0,5,0,5" Width="3" Opacity=".55" Visibility="Collapsed" Grid.Row="0" Grid.RowSpan="3"/>
              <RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" Width="22" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="2"/>
              <Thumb x:Name="VerticalThumb" Height="16" Width="16" IsTabStop="True" Grid.Row="1"/>
              <RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" Width="22" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="0"/>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--HyperlinkButton Style-->
  <Style TargetType="HyperlinkButton">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Padding" Value="2,0,2,0"/>
    <Setter Property="Cursor" Value="Hand"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="HyperlinkButton">
          <Grid Cursor="{TemplateBinding Cursor}" Background="{TemplateBinding Background}" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="UnderlineTextBlock" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="UnderlineTextBlock" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UnderlineTextBlock">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation Duration="0" To="0.65" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledOverlay"/>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <TextBlock x:Name="UnderlineTextBlock"  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Content}" TextDecorations="Underline" Foreground="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}"/>
            <ContentControl Foreground="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Opacity="0"/>
            </ContentControl>
            <TextBlock x:Name="DisabledOverlay" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed" Opacity=".55" Canvas.ZIndex="1" Foreground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Text="{TemplateBinding Content}"/>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" Margin="-2,-3,-2,-3" IsHitTestVisible="false" Opacity="0"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--ProgressBar Style-->
  <Style TargetType="ProgressBar">
    <Setter Property="Maximum" Value="100"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ProgressBar">
          <Grid x:Name="Root" Height="10">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Determinate"/>
                <VisualState x:Name="Indeterminate">
                  <Storyboard RepeatBehavior="Forever">
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateRoot" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeterminateRoot" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateGradientFill" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.Transform).(TransformGroup.Children)[0].X">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:.5" Value="20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="ProgressBarTrack" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="4"/>
            <Grid x:Name="ProgressBarRootGrid">
              <Grid x:Name="IndeterminateRoot" Visibility="Collapsed">
                <Rectangle x:Name="IndeterminateSolidFill" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Margin="1" Opacity="1" RenderTransformOrigin="0.5,0.5" RadiusX="4" RadiusY="4"/>
                <Rectangle x:Name="IndeterminateGradientFill" Margin="1" Opacity="0.75" RadiusX="4" RadiusY="4">
                  <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="20,1" MappingMode="Absolute" SpreadMethod="Repeat">
                      <LinearGradientBrush.Transform>
                        <TransformGroup>
                          <TranslateTransform X="0"/>
                          <SkewTransform AngleX="-30"/>
                        </TransformGroup>
                      </LinearGradientBrush.Transform>
                      <GradientStop Color="#FFFFFFFF" Offset="0"/>
                      <GradientStop Color="#00FFFFFF" Offset=".25"/>
                      <GradientStop Color="#FFFFFFFF" Offset="0.85"/>
                    </LinearGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
              </Grid>
              <Grid x:Name="DeterminateRoot" Margin="1">
                <Rectangle x:Name="ProgressBarIndicator" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" RadiusX="4" RadiusY="4"/>
              </Grid>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--TextBox Style-->
  <Style TargetType="TextBox">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="SelectionBackground"
            Binding="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="Foreground"
            Binding="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="TextBox">
          <Grid x:Name="RootElement" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ReadOnly">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".25"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="FocusVisualElement" Margin="-2" IsHitTestVisible="False" Opacity="0" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="3"/>
            <Border x:Name="Border" Opacity="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
              <Grid Margin="0">
                <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
                <ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="4,1,4,1"/>
              </Grid>
            </Border>
            <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2">
              <ToolTipService.ToolTip>
                <ToolTip x:Name="validationTooltip" Template="{StaticResource ValidationToolTipTemplate}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                  <ToolTip.Triggers>
                    <EventTrigger RoutedEvent="Canvas.Loaded">
                      <BeginStoryboard>
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                            <DiscreteObjectKeyFrame KeyTime="0">
                              <DiscreteObjectKeyFrame.Value>
                                <sys:Boolean>true</sys:Boolean>
                              </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </BeginStoryboard>
                    </EventTrigger>
                  </ToolTip.Triggers>
                </ToolTip>
              </ToolTipService.ToolTip>
            </Border>
            <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--PasswordBox Style-->
  <Style TargetType="PasswordBox">
    <Setter Property="FontFamily" Value="Verdana"/>
    <Setter Property="FontSize" Value="11.5"/>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="SelectionBackground"
            Binding="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="Foreground"
            Binding="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="PasswordBox">
          <Grid x:Name="RootElement" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="FocusVisualElement" Margin="-2" IsHitTestVisible="False" Opacity="0" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="3"/>
            <Border x:Name="Border" Opacity="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
              <Grid Margin="0">
                <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
                <Border x:Name="ContentElement" Padding="4,3,4,3"/>
              </Grid>
            </Border>
            <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2">
              <ToolTipService.ToolTip>
                <ToolTip x:Name="validationTooltip" Template="{StaticResource ValidationToolTipTemplate}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                  <ToolTip.Triggers>
                    <EventTrigger RoutedEvent="Canvas.Loaded">
                      <BeginStoryboard>
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                            <DiscreteObjectKeyFrame KeyTime="0">
                              <DiscreteObjectKeyFrame.Value>
                                <sys:Boolean>true</sys:Boolean>
                              </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </BeginStoryboard>
                    </EventTrigger>
                  </ToolTip.Triggers>
                </ToolTip>
              </ToolTipService.ToolTip>
            </Border>
            <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--ToolTip Template-->
  <Style TargetType="ToolTip">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ToolTip">
          <Border Background="{Binding ActiveCaptionBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2" MaxWidth="200">
            <ContentControl Foreground="{Binding ActiveCaptionTextBrush, Source={StaticResource SystemBrushes}}" Padding="6,4,6,4" VerticalAlignment="Center">
              <ContentPresenter
                Content="{TemplateBinding Content}"
                ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </ContentControl>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- *********SDK STYLES********* -->
  <!-- **************************** -->

  <!-- CalendarDayButton Style -->
  <Style TargetType="controlsPrimitives:CalendarDayButton">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS_Small}"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controlsPrimitives:CalendarDayButton">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Normal" GeneratedDuration="0:0:1" To="MouseOver"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To=".3"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To=".3"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To="0"/>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To=".35"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SelectionStates">
                <VisualState x:Name="Unselected"/>
                <VisualState x:Name="Selected">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="SelectedBackground" Storyboard.TargetProperty="Opacity" To=".75"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CalendarButtonFocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="CalendarButtonUnfocused" GeneratedDuration="0:0:1" To="CalendarButtonFocused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="CalendarButtonFocused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="CalendarButtonUnfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ActiveStates">
                <VisualState x:Name="Active"/>
                <VisualState x:Name="Inactive">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="DayStates">
                <VisualState x:Name="RegularDay"/>
                <VisualState x:Name="Today">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TodayBackground" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="BlackoutDayStates">
                <VisualState x:Name="NormalDay"/>
                <VisualState x:Name="BlackoutDay">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="BlackoutVisual" Storyboard.TargetProperty="Opacity" To=".2"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="TodayBackground" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlLightBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Opacity="0" RadiusX="1" RadiusY="1"/>
            <Rectangle x:Name="SelectedBackground" RadiusX="1" RadiusY="1" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
            <Rectangle x:Name="Background" RadiusX="1" RadiusY="1" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
            <ContentControl x:Name="Content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="8,2,8,2" IsTabStop="False"/>
            <Path x:Name="BlackoutVisual" Fill="{Binding ControlTextBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" HorizontalAlignment="Stretch" Margin="3" VerticalAlignment="Stretch" Opacity="0" RenderTransformOrigin="0.5,0.5" Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z"/>
            <Rectangle x:Name="FocusVisual" RadiusX="1" RadiusY="1" StrokeThickness="2" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- CalendarButton Style -->
  <Style TargetType="controlsPrimitives:CalendarButton">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS_Small}"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="UseLayoutRounding" Value="False"/>
    <Setter Property="MinWidth" Value="50.75"/>
    <Setter Property="MinHeight" Value="48"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controlsPrimitives:CalendarButton">
          <Grid UseLayoutRounding="False">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Normal" GeneratedDuration="0:0:1" To="MouseOver"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To=".5"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content_Active" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To=".5"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content_Active" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SelectionStates">
                <VisualState x:Name="Unselected"/>
                <VisualState x:Name="Selected">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="SelectedBackground" Storyboard.TargetProperty="Opacity" To=".75"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ActiveStates">
                <VisualState x:Name="Active"/>
                <VisualState x:Name="Inactive">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CalendarButtonFocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="CalendarButtonUnfocused" GeneratedDuration="0:0:1" To="CalendarButtonFocused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="CalendarButtonFocused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="CalendarButtonUnfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="SelectedBackground" RadiusX="1" RadiusY="1" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
            <Rectangle x:Name="Background" RadiusX="1" RadiusY="1" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Opacity="0"/>
            <ContentControl x:Name="Content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="6,4,6,4" IsTabStop="False"/>
            <ContentControl x:Name="Content_Active" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{Binding HighlightTextBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="6,4,6,4" IsTabStop="False" Visibility="Collapsed"/>
            <Rectangle x:Name="FocusVisual" RadiusX="1" RadiusY="1" StrokeThickness="2" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- CalendarItem Style -->
  <Style TargetType="controlsPrimitives:CalendarItem">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controlsPrimitives:CalendarItem">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledVisual">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisual"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Margin="0,2,0,2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
              <Border>
                <Grid>
                  <Grid.Resources>
                    <ControlTemplate x:Key="HeaderButtonTemplate" TargetType="Button">
                      <Grid Cursor="Hand">
                        <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                                  <EasingDoubleKeyFrame KeyTime="0" Value=".75"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled">
                              <Storyboard>
                                <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To=".55"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Pressed">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                                  <EasingDoubleKeyFrame KeyTime="0" Value=".75"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                          </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentControl x:Name="Content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontWeight="Bold" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="1,1,1,4" IsTabStop="False"/>
                      </Grid>
                    </ControlTemplate>
                    <DataTemplate x:Name="DayTitleTemplate">
                      <TextBlock Text="{Binding}" FontWeight="Bold" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,7,0,5"/>
                    </DataTemplate>
                    <ControlTemplate x:Key="PreviousButtonTemplate" TargetType="Button">
                      <Grid Cursor="Hand">
                        <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="Opacity">
                                  <EasingDoubleKeyFrame KeyTime="0" Value=".75"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled"/>
                            <VisualState x:Name="Pressed">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="Opacity">
                                  <EasingDoubleKeyFrame KeyTime="0" Value=".75"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                          </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="#01000000" Stretch="Fill"/>
                        <Grid>
                          <Path x:Name="path" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Height="10" Width="6" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="14,-2,0,0" Stretch="Fill" Data="M288.75,232.25 L288.75,240.625 L283,236.625 z"/>
                        </Grid>
                      </Grid>
                    </ControlTemplate>
                    <ControlTemplate x:Key="NextButtonTemplate" TargetType="Button">
                      <Grid Cursor="Hand">
                        <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="Opacity">
                                  <EasingDoubleKeyFrame KeyTime="0" Value=".75"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled"/>
                            <VisualState x:Name="Pressed">
                              <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="Opacity">
                                  <EasingDoubleKeyFrame KeyTime="0" Value=".75"/>
                                </DoubleAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                          </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="#01000000" Stretch="Fill"/>
                        <Grid>
                          <Path x:Name="path" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Height="10" Width="6" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,-2,14,0" Stretch="Fill" Data="M282.875,231.875 L282.875,240.375 L288.625,236 z"/>
                        </Grid>
                      </Grid>
                    </ControlTemplate>
                  </Grid.Resources>
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                  </Grid.ColumnDefinitions>
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                  </Grid.RowDefinitions>
                  <Button x:Name="PreviousButton" Template="{StaticResource PreviousButtonTemplate}" Height="22" Width="30" HorizontalAlignment="Left" Visibility="Collapsed" VerticalAlignment="Center"/>
                  <Button x:Name="HeaderButton" Template="{StaticResource HeaderButtonTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Margin="0,5,0,3"/>
                  <Button x:Name="NextButton" Template="{StaticResource NextButtonTemplate}" Height="22" Width="30" HorizontalAlignment="Right" Visibility="Collapsed" Grid.Column="2" VerticalAlignment="Center"/>
                  <Grid x:Name="MonthView" Margin="8,-1,8,8" Visibility="Collapsed" Grid.ColumnSpan="3" Grid.Row="1">
                    <Grid.RowDefinitions>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                  </Grid>
                  <Grid x:Name="YearView" Margin="8,5,8,8" Visibility="Collapsed" Grid.ColumnSpan="3" Grid.Row="1">
                    <Grid.RowDefinitions>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                      <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                  </Grid>
                </Grid>
              </Border>
            </Border>
            <Rectangle x:Name="DisabledVisual" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Stretch="Fill" Margin="0,2,0,2" Visibility="Collapsed"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- Calendar Style -->
  <Style TargetType="controls:Calendar">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Bold}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:Calendar">
          <StackPanel x:Name="Root" HorizontalAlignment="Center" TextOptions.TextHintingMode="Fixed">
            <controlsPrimitives:CalendarItem x:Name="CalendarItem" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Background="{Binding CalendarGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1"/>
          </StackPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- DatePickerTextBox Style -->
  <Style TargetType="controlsPrimitives:DatePickerTextBox">
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controlsPrimitives:DatePickerTextBox">
          <Grid x:Name="Root" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled"/>
                <VisualState x:Name="ReadOnly"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="WatermarkStates">
                <VisualState x:Name="Unwatermarked"/>
                <VisualState x:Name="Watermarked">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Opacity" To="0"/>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Watermark" Storyboard.TargetProperty="Opacity" To="1"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="InvalidFocused"/>
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="FocusVisual" IsHitTestVisible="False" Opacity="0" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" Margin="-2" BorderThickness="3"/>
            <Border x:Name="Border" Opacity="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
              <Grid x:Name="WatermarkContent" Background="{TemplateBinding Background}" Margin="1,1,0,1">
                <Border x:Name="ContentElement" Background="{TemplateBinding Background}" BorderThickness="0" Padding="3,0,0,0"/>
                <Border x:Name="ContentElement2" BorderThickness="0">
                  <ContentControl x:Name="Watermark" Background="{TemplateBinding Background}" Foreground="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Padding="2,0,2,0" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="False" Opacity="0" Content="{TemplateBinding Watermark}"/>
                </Border>
              </Grid>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- DatePicker Style -->
  <Style TargetType="controls:DatePicker">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Padding" Value="3,2,3,2"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:DatePicker">
          <Grid x:Name="Root">
            <Grid.Resources>
              <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="Button">
                <Grid>
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ButtonHighlight" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ButtonHighlight" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Grid Height="20" HorizontalAlignment="Center" Cursor="Hand" Margin="0" VerticalAlignment="Center" Width="21" Background="#01000000">
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="21*"/>
                      <ColumnDefinition Width="21*"/>
                      <ColumnDefinition Width="21*"/>
                      <ColumnDefinition Width="21*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                      <RowDefinition Height="20*"/>
                      <RowDefinition Height="19*"/>
                      <RowDefinition Height="19*"/>
                      <RowDefinition Height="22*"/>
                    </Grid.RowDefinitions>
                    <Border x:Name="Background" Margin="0,-1,0,0" Opacity="1" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" Background="{Binding WindowColor, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius=".5"/>
                    <Rectangle x:Name="NotButtonHighlight" StrokeThickness="1" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Grid.ColumnSpan="4" Grid.RowSpan="1" Fill="{Binding ActiveCaptionBrush, Source={StaticResource SystemBrushes}}"/>
                    <Rectangle x:Name="ButtonHighlight" StrokeThickness="1" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Grid.ColumnSpan="4" Grid.RowSpan="1" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
                    <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" HorizontalAlignment="Center" Margin="5,3.5,5,4" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" Data="M11.426758,8.4305077 L11.749023,8.4305077 L11.749023,16.331387 L10.674805,16.331387 L10.674805,10.299648 L9.0742188,11.298672 L9.0742188,10.294277 C9.4788408,10.090176 9.9094238,9.8090878 10.365967,9.4510155 C10.82251,9.0929432 11.176106,8.7527733 11.426758,8.4305077 z M14.65086,8.4305077 L18.566387,8.4305077 L18.566387,9.3435936 L15.671368,9.3435936 L15.671368,11.255703 C15.936341,11.058764 16.27293,10.960293 16.681133,10.960293 C17.411602,10.960293 17.969301,11.178717 18.354229,11.615566 C18.739157,12.052416 18.931622,12.673672 18.931622,13.479336 C18.931622,15.452317 18.052553,16.438808 16.294415,16.438808 C15.560365,16.438808 14.951641,16.234707 14.468243,15.826504 L14.881817,14.929531 C15.368796,15.326992 15.837872,15.525723 16.289043,15.525723 C17.298809,15.525723 17.803692,14.895514 17.803692,13.635098 C17.803692,12.460618 17.305971,11.873379 16.310528,11.873379 C15.83071,11.873379 15.399232,12.079271 15.016094,12.491055 L14.65086,12.238613 z" UseLayoutRounding="False"/>
                  </Grid>
                </Grid>
              </ControlTemplate>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To=".55"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <controlsPrimitives:DatePickerTextBox x:Name="TextBox" FontSize="{StaticResource FontS}" FontFamily="{StaticResource FontF_Normal}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Column="0" SelectionBackground="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
            <Button x:Name="Button" Template="{StaticResource DropDownButtonTemplate}" Margin="4,0,2,0" Width="21" Grid.Column="1"/>
            <Grid x:Name="DisabledVisual" IsHitTestVisible="False" Opacity="0" Grid.ColumnSpan="2">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <Rectangle Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
              <Rectangle Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Height="18" Margin="2,0,2,0" Width="19" Grid.Column="1"/>
            </Grid>
            <Popup x:Name="Popup"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- TabControl Style -->
  <Style TargetType="controls:TabControl">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="5"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:TabControl">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualTop" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0.55"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualBottom" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0.55"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualLeft" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0.55"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualRight" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0.55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="TemplateTop" Visibility="Collapsed">
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
              </Grid.RowDefinitions>
              <controlsPrimitives:TabPanel x:Name="TabPanelTop" Margin="2,2,2,-1" Canvas.ZIndex="1"/>
              <Border MinHeight="50" MinWidth="50" Grid.Row="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                <ContentPresenter x:Name="ContentTop" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
              </Border>
              <Border x:Name="DisabledVisualTop" IsHitTestVisible="False" Opacity="0" Grid.Row="1" Grid.RowSpan="2" Canvas.ZIndex="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
            </Grid>
            <Grid x:Name="TemplateBottom" Visibility="Collapsed">
              <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <controlsPrimitives:TabPanel x:Name="TabPanelBottom" Margin="2,-1,2,2" Grid.Row="1" Canvas.ZIndex="1"/>
              <Border MinHeight="10" MinWidth="10" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                <ContentPresenter x:Name="ContentBottom" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
              </Border>
              <Border x:Name="DisabledVisualBottom" IsHitTestVisible="False" Opacity="0" Canvas.ZIndex="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
            </Grid>
            <Grid x:Name="TemplateLeft" Visibility="Collapsed">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <controlsPrimitives:TabPanel x:Name="TabPanelLeft" Margin="2,2,-1,2" Canvas.ZIndex="1"/>
              <Border MinHeight="10" MinWidth="10" Grid.Column="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                <ContentPresenter x:Name="ContentLeft" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
              </Border>
              <Border x:Name="DisabledVisualLeft" IsHitTestVisible="False" Opacity="0" Grid.Column="1" Canvas.ZIndex="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
            </Grid>
            <Grid x:Name="TemplateRight" Visibility="Collapsed">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <controlsPrimitives:TabPanel x:Name="TabPanelRight" Margin="-1,2,2,2" Grid.Column="1" Canvas.ZIndex="1"/>
              <Border MinHeight="10" MinWidth="10" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                <ContentPresenter x:Name="ContentRight" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
              </Border>
              <Border x:Name="DisabledVisualRight" Margin="0" IsHitTestVisible="False" Opacity="0" Canvas.ZIndex="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- TabItem Style -->
  <Style TargetType="controls:TabItem">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="MinWidth" Value="5"/>
    <Setter Property="MinHeight" Value="5"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:TabItem">
          <Grid x:Name="Root">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChangeTop" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".2"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChangeBottom" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".2"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChangeLeft" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".2"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChangeRight" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".2"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualTopSelected"/>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualTopUnSelected"/>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualBottomSelected"/>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualBottomUnSelected"/>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualLeftSelected"/>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualLeftUnSelected"/>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualRightSelected"/>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualRightUnSelected"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SelectionStates">
                <VisualState x:Name="Unselected">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="BorderTop">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <CornerRadius>2,2,0,0</CornerRadius>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Selected"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualLeft"/>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualRight"/>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualTop"/>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBottom"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="TemplateTopSelected" Visibility="Collapsed" Canvas.ZIndex="1" Margin="3,0,0,0">
              <Border x:Name="FocusVisualTop" Margin="-4,-4,-4,1" IsHitTestVisible="false" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="3,3,3,0" CornerRadius="2,2,0,0" Opacity="0"/>
              <Border Margin="-2,-2,-2,0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1,1,1,0" CornerRadius="2,2,0,0">
                <ContentControl x:Name="HeaderTopSelected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              </Border>
              <Border x:Name="DisabledVisualTopSelected" Margin="-2,-2,-2,0" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="2,2,0,0"/>
            </Grid>
            <Grid x:Name="TemplateTopUnselected" Visibility="Collapsed" Cursor="Hand" Margin="3,0,0,0">
              <Border x:Name="BorderTop" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2,2,0,0"/>
              <Border x:Name="ColorChangeTop" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Margin="1" Opacity="0"/>
              <ContentControl x:Name="HeaderTopUnselected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              <Border x:Name="DisabledVisualTopUnSelected" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="2,2,0,0"/>
            </Grid>
            <Grid x:Name="TemplateBottomSelected" Visibility="Collapsed" Canvas.ZIndex="1" Margin="3,0,0,0">
              <Border x:Name="FocusVisualBottom" Margin="-4,0,-4,-4" IsHitTestVisible="false" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="3,0,3,3" CornerRadius="0,0,2,2" Opacity="0"/>
              <Border Margin="-2,0,-2,-2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1,0,1,1" CornerRadius="0,0,2,2">
                <ContentControl x:Name="HeaderBottomSelected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              </Border>
              <Border x:Name="DisabledVisualBottomSelected" Margin="-2,0,-2,-2" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="0,0,2,2"/>
            </Grid>
            <Grid x:Name="TemplateBottomUnselected" Visibility="Collapsed" Cursor="Hand" Margin="3,0,0,0">
              <Border x:Name="BorderBottom" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="0,0,2,2"/>
              <Border x:Name="ColorChangeBottom" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Margin="1" Opacity="0"/>
              <ContentControl x:Name="HeaderBottomUnselected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              <Border x:Name="DisabledVisualBottomUnSelected" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="0,0,2,2"/>
            </Grid>

            <Grid x:Name="TemplateLeftSelected" Visibility="Collapsed" Canvas.ZIndex="1" Margin="0,3,0,0">
              <Border x:Name="FocusVisualLeft" Margin="-4,-4,0,-4" IsHitTestVisible="false" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="3,3,0,3" CornerRadius="2,0,0,2" Opacity="0"/>
              <Border Margin="-2,-2,0,-2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1,1,0,1" CornerRadius="2,0,0,2">
                <ContentControl x:Name="HeaderLeftSelected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              </Border>
              <Border x:Name="DisabledVisualLeftSelected" Margin="-2,-2,0,-2" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="2,0,0,2"/>
            </Grid>
            <Grid x:Name="TemplateLeftUnselected" Visibility="Collapsed" Cursor="Hand" Margin="0,3,0,0">
              <Border x:Name="BorderLeft" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2,0,0,2"/>
              <Border x:Name="ColorChangeLeft" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Margin="1" Opacity="0"/>
              <ContentControl x:Name="HeaderLeftUnselected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              <Border x:Name="DisabledVisualLeftUnSelected" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="2,0,0,2"/>
            </Grid>

            <Grid x:Name="TemplateRightSelected" Visibility="Collapsed" Canvas.ZIndex="1" Margin="0,3,0,0">
              <Border x:Name="FocusVisualRight" Margin="0,-4,-4,-4" IsHitTestVisible="false" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="0,3,3,3" CornerRadius="0,2,2,0" Opacity="0"/>
              <Border Margin="0,-2,-2,-2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="0,1,1,1" CornerRadius="0,2,2,0">
                <ContentControl x:Name="HeaderRightSelected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              </Border>
              <Border x:Name="DisabledVisualRightSelected" Margin="0,-2,-2,-2" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="0,2,2,0"/>
            </Grid>
            <Grid x:Name="TemplateRightUnselected" Visibility="Collapsed" Cursor="Hand" Margin="0,3,0,0">
              <Border x:Name="BorderRight" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="0,2,2,0"/>
              <Border x:Name="ColorChangeRight" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Margin="1" Opacity="0"/>
              <ContentControl x:Name="HeaderRightUnselected" FontSize="11.5" FontFamily="Verdana" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" IsTabStop="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,5"/>
              <Border x:Name="DisabledVisualRightUnSelected" IsHitTestVisible="false" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="0,2,2,0"/>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- GridSplitter Style -->
  <Style TargetType="controls:GridSplitter">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="IsTabStop" Value="true"/>
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="PreviewStyle">
      <Setter.Value>
        <Style TargetType="Control">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="Control">
                <Grid x:Name="Root" Opacity=".5">
                  <Rectangle Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
                  <Grid x:Name="HorizontalTemplate" Height="6"/>
                  <Grid x:Name="VerticalTemplate" Width="6" Visibility="Collapsed"/>
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:GridSplitter">
          <Grid x:Name="Root" IsHitTestVisible="{TemplateBinding IsEnabled}" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0.55"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Unfocused"/>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
            <Grid x:Name="HorizontalTemplate" Height="10">
              <StackPanel Height="6" VerticalAlignment="Center">
                <Rectangle Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Height="1" Margin="1" Width="10"/>
                <Rectangle Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Height="1" Margin="1" Width="10"/>
              </StackPanel>
            </Grid>
            <Grid x:Name="VerticalTemplate" Width="10" Visibility="Collapsed">
              <StackPanel VerticalAlignment="Center" Width="6" Orientation="Horizontal">
                <Rectangle Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Height="10" Margin="1" Width="1"/>
                <Rectangle Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Height="10" Margin="1" Width="1"/>
              </StackPanel>
            </Grid>
            <Rectangle x:Name="FocusVisual" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" IsHitTestVisible="false" Opacity="0"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ChildWindow Style -->
  <Style TargetType="controls:ChildWindow">
    <Setter Property="IsTabStop" Value="false"/>
    <Setter Property="TabNavigation" Value="Cycle"/>
    <Setter Property="HorizontalAlignment" Value="Center"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:ChildWindow">
          <Grid x:Name="Root" TextOptions.TextHintingMode="Fixed">
            <Grid.Resources>
              <Style x:Key="ButtonStyle" TargetType="Button">
                <Setter Property="Padding" Value="3"/>
                <Setter Property="Template">
                  <Setter.Value>
                    <ControlTemplate TargetType="Button">
                      <Grid x:Name="grid" Height="14" Cursor="Hand" HorizontalAlignment="Center" VerticalAlignment="Center" Width="15" Background="#01FFFFFF">
                        <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                              <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility">
                                  <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility">
                                  <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility">
                                  <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.95"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Pressed">
                              <Storyboard>
                                <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.85"/>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility">
                                  <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility">
                                  <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility">
                                  <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled">
                              <Storyboard>
                                <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To=".55"/>
                              </Storyboard>
                            </VisualState>
                          </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path x:Name="X_Fuzz2" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Stroke="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity=".1" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                          <Path.RenderTransform>
                            <TransformGroup>
                              <ScaleTransform ScaleX="1.3" ScaleY="1.3"/>
                            </TransformGroup>
                          </Path.RenderTransform>
                        </Path>
                        <Path x:Name="X_Fuzz1" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Stroke="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity=".1" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                          <Path.RenderTransform>
                            <TransformGroup>
                              <ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
                            </TransformGroup>
                          </Path.RenderTransform>
                        </Path>
                        <Path x:Name="X_Fuzz0" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Stroke="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="1" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z"/>
                        <Path x:Name="X" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="0.7" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z"/>
                      </Grid>
                    </ControlTemplate>
                  </Setter.Value>
                </Setter>
              </Style>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="WindowStates">
                <VisualState x:Name="Open">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="Overlay" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:0.3" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.25" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.4" Value="1"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.45" Value="1.05" KeySpline="0,0,0.5,1"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.55" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.25" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.4" Value="1"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.45" Value="1.05" KeySpline="0,0,0.5,1"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.55" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Closed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="Overlay" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:0.3" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                      <SplineDoubleKeyFrame KeyTime="00:00:0.2" Value="1"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.25" Value="1.05"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.45" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                      <SplineDoubleKeyFrame KeyTime="00:00:0.2" Value="1"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.25" Value="1.05"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:0.45" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="Overlay" HorizontalAlignment="Stretch" VerticalAlignment="Top" Background="#7F000000"/>
            <Grid x:Name="ContentRoot" Height="{TemplateBinding Height}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}" RenderTransformOrigin=".5,.5">
              <Grid.RenderTransform>
                <TransformGroup>
                  <ScaleTransform/>
                  <SkewTransform/>
                  <RotateTransform/>
                  <TranslateTransform/>
                </TransformGroup>
              </Grid.RenderTransform>
              <Border HorizontalAlignment="Stretch" Margin="-2" VerticalAlignment="Stretch" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="1" Opacity=".055"/>
              <Border HorizontalAlignment="Stretch" Margin="-4" VerticalAlignment="Stretch" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2.25" Opacity=".04"/>
              <Border HorizontalAlignment="Stretch" Margin="-6" VerticalAlignment="Stretch" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="3.5" Opacity=".025"/>
              <Border HorizontalAlignment="Stretch" Margin="-8" VerticalAlignment="Stretch" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="4.75" Opacity=".01"/>
              <Border Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                <Grid>
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                  </Grid.RowDefinitions>
                  <Border x:Name="Chrome" Width="Auto" BorderBrush="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="0,0,0,1" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}">
                    <Grid Height="Auto" Width="Auto">
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="30"/>
                      </Grid.ColumnDefinitions>
                      <ContentControl Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" FontFamily="{StaticResource FontF_Bold}" FontSize="{StaticResource FontS}" FontWeight="Bold" IsTabStop="False" HorizontalAlignment="Stretch" Margin="7,5,7,5" VerticalAlignment="Center" Content="{TemplateBinding Title}"/>
                      <Button x:Name="CloseButton" IsTabStop="False" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" Width="15" Grid.Column="1"/>
                    </Grid>
                  </Border>
                  <Border Margin="7" Grid.Row="1">
                    <ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                  </Border>
                </Grid>
              </Border>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--TreeView Style-->
  <Style TargetType="controls:TreeView">
    <Setter Property="Background" Value="#FFFFFFFF"/>
    <Setter Property="Foreground" Value="#FF000000"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Cursor" Value="Arrow"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Padding" Value="1"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="IsTabStop" Value="True"/>
    <Setter Property="TabNavigation" Value="Once"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:TreeView">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Unfocused"/>
                <VisualState x:Name="Focused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationToolTip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border BorderBrush="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}">
              <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
                <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" IsTabStop="False" TabNavigation="Once" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                  <ItemsPresenter Margin="5"/>
                </ScrollViewer>
              </Border>
            </Border>
            <Border x:Name="Validation" Visibility="Collapsed" Grid.Column="1" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
              <ToolTipService.ToolTip>
                <ToolTip x:Name="ValidationToolTip" Template="{StaticResource ValidationToolTipTemplate}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" IsHitTestVisible="True" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"/>
              </ToolTipService.ToolTip>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--TreeViewItem Style-->
  <Style TargetType="controls:TreeViewItem">
    <Setter Property="Padding" Value="3"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Cursor" Value="Arrow"/>
    <Setter Property="IsTabStop" Value="True"/>
    <Setter Property="TabNavigation" Value="Once"/>
    <Setter Property="Margin" Value="0 1 0 0"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controls:TreeViewItem">
          <Grid Background="Transparent" TextOptions.TextHintingMode="Fixed">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="15"/>
              <ColumnDefinition Width="Auto"/>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SelectionStates">
                <VisualState x:Name="Unselected"/>
                <VisualState x:Name="Selected">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Selection" Storyboard.TargetProperty="Opacity" To=".75"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="SelectedInactive">
                  <Storyboard>
                    <DoubleAnimation Duration="0" Storyboard.TargetName="Selection" Storyboard.TargetProperty="Opacity" To=".2"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="HasItemsStates">
                <VisualState x:Name="HasItems"/>
                <VisualState x:Name="NoItems">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualState x:Name="Collapsed"/>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationToolTip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ToggleButton Cursor="Hand" x:Name="ExpanderButton" IsTabStop="False" TabNavigation="Once" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <ToggleButton.Template>
                <ControlTemplate TargetType="ToggleButton">
                  <Grid x:Name="Root" Background="Transparent" TextOptions.TextHintingMode="Fixed">
                    <VisualStateManager.VisualStateGroups>
                      <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                          <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="UncheckedVisualHighlight" Storyboard.TargetProperty="Opacity" To="1"/>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckedVisualHighlight" Storyboard.TargetProperty="Opacity">
                              <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Disabled">
                          <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To=".7"/>
                          </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Pressed">
                          <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="UncheckedVisualHighlight" Storyboard.TargetProperty="Opacity">
                              <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckedVisualHighlight" Storyboard.TargetProperty="Opacity">
                              <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                      </VisualStateGroup>
                      <VisualStateGroup x:Name="CheckStates">
                        <VisualState x:Name="Unchecked"/>
                        <VisualState x:Name="Checked">
                          <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="UncheckedVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckedVisualHighlight" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                  <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rectangle" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                  <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                      </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Grid HorizontalAlignment="Right" Margin="2 2 5 2">
                      <Path x:Name="UncheckedVisual" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeLineJoin="Miter" StrokeThickness="1" Height="9" HorizontalAlignment="Right" VerticalAlignment="Center" Width="6" Data="M 0,0 L 0,9 L 5,4.5 Z"/>
                      <Path x:Name="UncheckedVisualHighlight" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" StrokeLineJoin="Miter" StrokeThickness="1" Height="9" Opacity="0" HorizontalAlignment="Right" VerticalAlignment="Center" Width="6" Data="M 0,0 L 0,9 L 5,4.5 Z"/>
                      <Rectangle x:Name="rectangle" Height="9" Width="6" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Visibility="Collapsed"/>
                      <Path x:Name="CheckedVisual" Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeLineJoin="Miter" Height="6" HorizontalAlignment="Center" VerticalAlignment="Center" Width="6" Opacity="0" Data="M 6,0 L 6,6 L 0,6 Z"/>
                      <Path x:Name="CheckedVisualHighlight" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" StrokeLineJoin="Miter" Height="6" HorizontalAlignment="Center" VerticalAlignment="Center" Width="6" Opacity="0" Data="M 6,0 L 6,6 L 0,6 Z" Visibility="Collapsed"/>
                    </Grid>
                  </Grid>
                </ControlTemplate>
              </ToggleButton.Template>
            </ToggleButton>
            <Border x:Name="Selection" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" IsHitTestVisible="False" Opacity="0" Grid.Column="1">
              <Border Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity=".3"/>
            </Border>
            <Button x:Name="Header" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Foreground="{TemplateBinding Foreground}" IsTabStop="False" TabNavigation="Once" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" ClickMode="Hover">
              <Button.Template>
                <ControlTemplate TargetType="Button">
                  <Grid Background="{TemplateBinding Background}">
                    <VisualStateManager.VisualStateGroups>
                      <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="Pressed">
                          <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity" To=".5"/>
                          </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Disabled">
                          <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To=".55"/>
                          </Storyboard>
                        </VisualState>
                      </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border x:Name="Hover" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" IsHitTestVisible="False" Opacity="0">
                      <Border Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity=".2" />
                    </Border>
                    <ContentControl Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" FontFamily="{StaticResource FontF_Normal}" FontSize="{StaticResource FontS}" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="Left" Margin="7,5,7,5">
                      <ContentPresenter x:Name="Content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </ContentControl>
                  </Grid>
                </ControlTemplate>
              </Button.Template>
              <ContentControl Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" FontFamily="{StaticResource FontF_Normal}" FontSize="{StaticResource FontS}">
                <ContentPresenter Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
              </ContentControl>
            </Button>
            <Border x:Name="Validation" Visibility="Collapsed" Grid.Column="1" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
              <ToolTipService.ToolTip>
                <ToolTip x:Name="ValidationToolTip" Template="{StaticResource ValidationToolTipTemplate}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" IsHitTestVisible="True" Placement="Right" PlacementTarget="{Binding ElementName=Header}"/>
              </ToolTipService.ToolTip>
            </Border>
            <ItemsPresenter x:Name="ItemsHost" Visibility="Collapsed" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--LabelStyle-->
  <Style TargetType="dataInput:Label">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="dataInput:Label">
          <StackPanel Orientation="Horizontal">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="Invalid">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0:0:1.5" Storyboard.TargetName="ContentControl" Storyboard.TargetProperty="Foreground">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <SolidColorBrush Color="Red"/>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="RequiredStates">
                <VisualState x:Name="NotRequired"/>
                <VisualState x:Name="Required">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentControl" Storyboard.TargetProperty="FontWeight">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="SemiBold"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
              <ContentControl x:Name="ContentControl" TextOptions.TextHintingMode="Fixed" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" FontStretch="{TemplateBinding FontStretch}" FontWeight="{TemplateBinding FontWeight}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </Border>
          </StackPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--CommonValidationToolTipTemplate Style-->
  <!-- If you use AutoCompleteBoxStyle in a separate project-->
  <!--Be sure to include this ControlTemplate xaml for Validation Ux-->
  <!--AutoCompleteBoxStyle has a dependency on it-->
  <ControlTemplate x:Key="CommonValidationToolTipTemplate">
    <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="OpenStates">
          <VisualStateGroup.Transitions>
            <VisualTransition GeneratedDuration="0"/>
            <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
              <Storyboard>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                  <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                  <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualTransition>
          </VisualStateGroup.Transitions>
          <VisualState x:Name="Closed">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Open">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <Grid.RenderTransform>
        <TranslateTransform x:Name="xform" X="-25"/>
      </Grid.RenderTransform>
      <Border Margin="4,4,-4,-4" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".05" CornerRadius="5"/>
      <Border Margin="3,3,-3,-3" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".06" CornerRadius="4"/>
      <Border Margin="2,2,-2,-2" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".07" CornerRadius="3"/>
      <Border Margin="1,1,-1,-1" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".08" CornerRadius="2"/>
      <Border Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" CornerRadius="1"/>
      <Border CornerRadius="1">
        <TextBlock Text="{Binding (Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap" Foreground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" FontFamily="{StaticResource FontF_Normal}" FontSize="{StaticResource FontS}" Margin="8,4,8,4" MaxWidth="250" UseLayoutRounding="false"/>
      </Border>
    </Grid>
  </ControlTemplate>

  <!--AutoCompleteBoxStyle-->
  <!-- If you use AutoCompleteBoxStyle in a separate project-->
  <!--Be sure to include this ControlTemplate xaml for Validation Ux-->
  <!--AutoCompleteBoxStyle has a dependency on it-->
  <Style TargetType="input:AutoCompleteBox">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Padding" Value="2"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="MinWidth" Value="45"/>
    <Setter Property="Height" Value="22"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="input:AutoCompleteBox">
          <Grid Opacity="{TemplateBinding Opacity}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="PopupStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0:0:0.1" To="PopupOpened"/>
                  <VisualTransition GeneratedDuration="0:0:0.2" To="PopupClosed"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="PopupOpened">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="1.0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="PopupClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="0.0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="Disabled"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Normal"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <TextBox x:Name="Text" Margin="0" BorderThickness="1" IsTabStop="True" Padding="{TemplateBinding Padding}">
              <TextBox.Resources>
                <ControlTemplate x:Key="ValidationToolTipTemplate">
                  <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
                    <Grid.RenderTransform>
                      <TranslateTransform x:Name="xform" X="-25"/>
                    </Grid.RenderTransform>
                    <VisualStateManager.VisualStateGroups>
                      <VisualStateGroup x:Name="OpenStates">
                        <VisualStateGroup.Transitions>
                          <VisualTransition GeneratedDuration="0"/>
                          <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
                            <Storyboard>
                              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                              </DoubleAnimationUsingKeyFrames>
                              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
                              </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                          </VisualTransition>
                        </VisualStateGroup.Transitions>
                        <VisualState x:Name="Closed">
                          <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                              <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Open">
                          <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                              <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                              <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                      </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border Margin="4,4,-4,-4" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".05" CornerRadius="5"/>
                    <Border Margin="3,3,-3,-3" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".06" CornerRadius="4"/>
                    <Border Margin="2,2,-2,-2" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".07" CornerRadius="3"/>
                    <Border Margin="1,1,-1,-1" Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Opacity=".08" CornerRadius="2"/>
                    <Border Background="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" CornerRadius="2"/>
                    <Border CornerRadius="0">
                      <TextBlock Margin="8,4,8,4" MaxWidth="250" UseLayoutRounding="false" Foreground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Text="{Binding (Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap"/>
                    </Border>
                  </Grid>
                </ControlTemplate>
                <Style x:Key="AutoCompleteBoxTextBoxStyle" TargetType="TextBox">
                  <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
                  <Setter Property="FontSize" Value="{StaticResource FontS}"/>
                  <Setter Property="BorderThickness" Value="1"/>
                  <Setter Property="Padding" Value="2"/>
                  <Setter Property="Template">
                    <Setter.Value>
                      <ControlTemplate TargetType="TextBox">
                        <Grid x:Name="RootElement">
                          <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                              <VisualState x:Name="Normal"/>
                              <VisualState x:Name="MouseOver"/>
                              <VisualState x:Name="Disabled">
                                <Storyboard>
                                  <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                    <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                                  </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                              <VisualState x:Name="ReadOnly">
                                <Storyboard>
                                  <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                                    <SplineDoubleKeyFrame KeyTime="0" Value=".25"/>
                                  </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                              <VisualStateGroup.Transitions>
                                <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                              </VisualStateGroup.Transitions>
                              <VisualState x:Name="Focused">
                                <Storyboard>
                                  <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                  </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                              <VisualState x:Name="Unfocused">
                                <Storyboard>
                                  <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                    <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                  </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                              <VisualState x:Name="Valid"/>
                              <VisualState x:Name="InvalidUnfocused">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                      <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                      </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                              <VisualState x:Name="InvalidFocused">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                      <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                      </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                  </ObjectAnimationUsingKeyFrames>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                      <DiscreteObjectKeyFrame.Value>
                                        <sys:Boolean>True</sys:Boolean>
                                      </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                            </VisualStateGroup>
                          </VisualStateManager.VisualStateGroups>
                          <Border x:Name="FocusVisualElement" Margin="-2" IsHitTestVisible="False" Opacity="0" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="3"/>
                          <Border x:Name="Border" Opacity="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                            <Grid>
                              <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
                              <ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="4,1,4,1" VerticalAlignment="Center"/>
                            </Grid>
                          </Border>
                          <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="{Binding ControlLightLightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlLightLightBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1"/>
                          <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" CornerRadius="1">
                            <ToolTipService.ToolTip>
                              <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                <ToolTip.Triggers>
                                  <EventTrigger RoutedEvent="Canvas.Loaded">
                                    <BeginStoryboard>
                                      <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                          <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                              <sys:Boolean>true</sys:Boolean>
                                            </DiscreteObjectKeyFrame.Value>
                                          </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                      </Storyboard>
                                    </BeginStoryboard>
                                  </EventTrigger>
                                </ToolTip.Triggers>
                              </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Background="Transparent">
                              <Path Fill="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}"  Margin="1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
                              <Path Fill="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}"  Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
                            </Grid>
                          </Border>
                        </Grid>
                      </ControlTemplate>
                    </Setter.Value>
                  </Setter>
                </Style>
              </TextBox.Resources>
              <TextBox.Foreground>
                <Binding Path="ControlDarkDarkBrush" Source="{StaticResource SystemBrushes}"/>
              </TextBox.Foreground>
              <TextBox.SelectionForeground>
                <Binding Path="HighlightTextBrush" Source="{StaticResource SystemBrushes}"/>
              </TextBox.SelectionForeground>
              <TextBox.SelectionBackground>
                <Binding Path="ControlDarkBrush" Source="{StaticResource SystemBrushes}"/>
              </TextBox.SelectionBackground>
              <TextBox.Background>
                <Binding Path="WindowBrush" Source="{StaticResource SystemBrushes}"/>
              </TextBox.Background>
              <TextBox.BorderBrush>
                <Binding Path="ControlDarkBrush" Source="{StaticResource SystemBrushes}"/>
              </TextBox.BorderBrush>
              <TextBox.Style>
                <StaticResource ResourceKey="AutoCompleteBoxTextBoxStyle"/>
              </TextBox.Style>
            </TextBox>
            <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" >
              <ToolTipService.ToolTip>
                <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource CommonValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                  <ToolTip.Triggers>
                    <EventTrigger RoutedEvent="Canvas.Loaded">
                      <BeginStoryboard>
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                            <DiscreteObjectKeyFrame KeyTime="0">
                              <DiscreteObjectKeyFrame.Value>
                                <sys:Boolean>true</sys:Boolean>
                              </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </BeginStoryboard>
                    </EventTrigger>
                  </ToolTip.Triggers>
                </ToolTip>
              </ToolTipService.ToolTip>
              <Grid Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Background="Transparent">
                <Path Fill="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Margin="1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
                <Path Fill="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}" Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
              </Grid>
            </Border>
            <Popup x:Name="Popup">
              <Grid Opacity="{TemplateBinding Opacity}">
                <Border x:Name="PopupBorder" HorizontalAlignment="Stretch" Opacity="0" Background="Transparent">
                  <Border.RenderTransform>
                    <TranslateTransform X="1" Y="1"/>
                  </Border.RenderTransform>
                  <Border HorizontalAlignment="Stretch" Opacity="1.0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" CornerRadius="0" Padding="0">
                    <Border.RenderTransform>
                      <TransformGroup>
                        <TranslateTransform X="-1" Y="-1"/>
                      </TransformGroup>
                    </Border.RenderTransform>
                    <ListBox x:Name="Selector" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Foreground="{TemplateBinding Foreground}" ItemTemplate="{TemplateBinding ItemTemplate}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" />
                  </Border>
                </Border>
              </Grid>
            </Popup>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataPagerStyle-->
  <Style TargetType="data:DataPager">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="HorizontalContentAlignment" Value="Right"/>
    <Setter Property="NumericButtonStyle">
      <Setter.Value>
        <Style TargetType="ToggleButton">
          <Setter Property="MinHeight" Value="24"/>
          <Setter Property="MinWidth" Value="24"/>
          <Setter Property="HorizontalAlignment" Value="Right"/>
          <Setter Property="VerticalAlignment" Value="Center"/>
          <Setter Property="BorderThickness" Value="1"/>
          <Setter Property="Padding" Value="1"/>
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="ToggleButton">
                <Grid Margin="1" Cursor="Hand">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" To=".55"/>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed"/>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" To="0.45"/>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CheckStates">
                      <VisualState x:Name="Checked">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="CheckedStateOuterBorder" Storyboard.TargetProperty="Opacity" To=".4"/>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unchecked"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Border x:Name="FocusVisualElement" Background="Transparent" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1.5" CornerRadius="1" Opacity="0" Margin="0"/>
                  <Border x:Name="MouseOverBorder" CornerRadius="1" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" Margin="1"/>
                  <Border x:Name="CheckedStateOuterBorder" CornerRadius="1" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1.25" Opacity="0" Margin="1"/>
                  <Border x:Name="InnerBtnBorder">
                    <ContentControl x:Name="contentControl" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center">
                      <ContentPresenter x:Name="contentPresenter" TextOptions.TextHintingMode="Fixed" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </ContentControl>
                  </Border>
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="data:DataPager">
          <Grid x:Name="Root">
            <Grid.Resources>
              <ControlTemplate x:Key="ButtonTemplate" TargetType="Button">
                <Grid Margin="1" MinHeight="24" MinWidth="24">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" To=".55"/>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard/>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="path" Storyboard.TargetProperty="Opacity" To="0.45"/>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Border x:Name="FocusVisualElement" Background="Transparent" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1.5" CornerRadius="1" Opacity="0" Margin="0"/>
                  <Border x:Name="MouseOverBorder" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Margin="1" Opacity="0" />
                  <Border x:Name="InnerBtnBorder" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius=".5">
                    <ContentPresenter x:Name="path" Content="{TemplateBinding Content}"/>
                  </Border>
                </Grid>
              </ControlTemplate>
              <Style x:Key="PagingTextBoxStyle" TargetType="TextBox">
                <Setter Property="Template">
                  <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                      <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal">
                              <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="NormalBorder" Storyboard.TargetProperty="Opacity" To="1"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="MouseOver">
                              <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="NormalBorder" Storyboard.TargetProperty="Opacity" To="1"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled">
                              <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To=".55"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="ReadOnly">
                              <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                              </Storyboard>
                            </VisualState>
                          </VisualStateGroup>
                          <VisualStateGroup x:Name="FocusStates">
                            <VisualState x:Name="Focused">
                              <Storyboard>
                                <DoubleAnimation To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusVisualElement"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Unfocused"/>
                          </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="FocusVisualElement" Background="Transparent" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1.5" CornerRadius="0" Opacity="0" Margin="0"/>
                        <Border x:Name="Border" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                          <Grid>
                            <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
                            <Border x:Name="NormalBorder" Background="Transparent" BorderBrush="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Opacity="0">
                              <ScrollViewer x:Name="ContentElement" TextOptions.TextHintingMode="Fixed" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Margin="0" BorderThickness="0" Padding="2,1,2,1"/>
                            </Border>
                          </Grid>
                        </Border>
                        <Border x:Name="DisabledVisualElement" Margin="0" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
                      </Grid>
                    </ControlTemplate>
                  </Setter.Value>
                </Setter>
              </Style>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="CurrentPagePrefixTextBlock" Storyboard.TargetProperty="Opacity" To="0.45"/>
                    <DoubleAnimation  Storyboard.TargetName="CurrentPageSuffixTextBlock" Storyboard.TargetProperty="Opacity" To="0.45"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="MoveStates">
                <VisualState x:Name="MoveEnabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPageTextBox" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MoveDisabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPageTextBox" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="MoveFirstStates">
                <VisualState x:Name="MoveFirstEnabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MoveFirstDisabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="MovePreviousStates">
                <VisualState x:Name="MovePreviousEnabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MovePreviousDisabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="MoveNextStates">
                <VisualState x:Name="MoveNextEnabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MoveNextDisabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="MoveLastStates">
                <VisualState x:Name="MoveLastEnabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MoveLastDisabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastPageButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="DisplayModeStates">
                <VisualState x:Name="FirstLastNumeric">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPageTextBox" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PageDisplay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="FirstLastPreviousNext">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumericButtonPanel" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="FirstLastPreviousNextNumeric">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPageTextBox" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PageDisplay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Numeric">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPageTextBox" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PageDisplay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Separator1" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Separator2" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="PreviousNext">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumericButtonPanel" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="PreviousNextNumeric">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastPageButton" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPageTextBox" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PageDisplay" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
              <StackPanel HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="Stretch" Orientation="Horizontal">
                <Button x:Name="FirstPageButton" Cursor="Hand" HorizontalAlignment="Right" VerticalAlignment="Center" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Padding="1" Template="{StaticResource ButtonTemplate}">
                  <Grid Height="9" Width="8">
                    <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="9" HorizontalAlignment="Right" Width="5" Data="M0,1 L1,0 L1,2 Z"/>
                    <Rectangle Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" Width="2"/>
                  </Grid>
                </Button>
                <Button x:Name="PreviousPageButton" Cursor="Hand" HorizontalAlignment="Right" VerticalAlignment="Center" BorderThickness="1" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Padding="1" Template="{StaticResource ButtonTemplate}">
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="9" HorizontalAlignment="Center" Width="5" Data="M0,1 L1,0 L1,2 Z"/>
                </Button>
                <Border x:Name="Separator1" Margin="0,3" Width="1" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1,0,1,0"/>
                <StackPanel x:Name="NumericButtonPanel" Margin="1" Orientation="Horizontal"/>
                <StackPanel x:Name="PageDisplay" Orientation="Horizontal">
                  <TextBlock x:Name="CurrentPagePrefixTextBlock" TextOptions.TextHintingMode="Fixed" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" VerticalAlignment="Center" Margin="4,0,0,0"/>
                  <TextBox x:Name="CurrentPageTextBox" TextOptions.TextHintingMode="Fixed" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Width="40" VerticalAlignment="Center" TextWrapping="Wrap" Margin="4,2,4,2" Style="{StaticResource PagingTextBoxStyle}"/>
                  <TextBlock x:Name="CurrentPageSuffixTextBlock" TextOptions.TextHintingMode="Fixed" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" VerticalAlignment="Center" Width="Auto" Margin="0,0,4,0"/>
                </StackPanel>
                <Border x:Name="Separator2" Margin="0,3" Width="1" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1,0,1,0"/>
                <Button x:Name="NextPageButton" Cursor="Hand" HorizontalAlignment="Right" VerticalAlignment="Center" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}"  Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Padding="1" Template="{StaticResource ButtonTemplate}">
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="9" HorizontalAlignment="Center" Width="5" Data="M0,0 L1,1 L0,2 Z"/>
                </Button>
                <Button x:Name="LastPageButton" Cursor="Hand" HorizontalAlignment="Right" VerticalAlignment="Center" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Padding="1" Template="{StaticResource ButtonTemplate}">
                  <Grid Height="9" Width="8">
                    <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="9" HorizontalAlignment="Left" Width="5" Data="M0,0 L1,1 L0,2 Z"/>
                    <Rectangle Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Right" Width="2"/>
                  </Grid>
                </Button>
              </StackPanel>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataGridCellStyle-->
  <Style TargetType="data:DataGridCell">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="data:DataGridCell">
          <Grid x:Name="Root" Background="{TemplateBinding Background}" UseLayoutRounding="False">
            <Grid.ColumnDefinitions>
              <ColumnDefinition/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CurrentStates">
                <VisualState x:Name="Regular"/>
                <VisualState x:Name="Current">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="Invalid">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="InvalidVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="FocusVisual" Fill="Transparent" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="false" Opacity="0"/>
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="4,-1,4,-1"/>
            <Rectangle x:Name="InvalidVisualElement" Stroke="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False" Opacity="0"/>
            <Rectangle x:Name="RightGridLine" VerticalAlignment="Stretch" Width="0" Grid.Column="1" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Opacity=".3" Canvas.ZIndex="2"/>
            <Rectangle x:Name="BottomGridLine" Fill="Transparent" HorizontalAlignment="Stretch" Height="1" Grid.Row="1" Opacity=".3"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataGridColumnHeaderStyle-->
  <Style TargetType="dataPrimitives:DataGridColumnHeader">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="dataPrimitives:DataGridColumnHeader">
          <Grid x:Name="Root" Cursor="Hand">
            <Grid.ColumnDefinitions>
              <ColumnDefinition/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".55"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".65"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SortStates">
                <VisualState x:Name="Unsorted"/>
                <VisualState x:Name="SortAscending">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" To="1.0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="SortDescending">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" To="1.0"/>
                    <DoubleAnimation  Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="(RenderTransform).ScaleY" To="-.9"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="BackgroundGradient" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stretch="Fill" Grid.ColumnSpan="2"/>
            <Rectangle x:Name="BackgroundRectangle" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Grid.ColumnSpan="2" Opacity="0"/>
            <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
              <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <ContentControl x:Name="contentControl" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center">
                <ContentPresenter Content="{TemplateBinding Content}" Margin="4,1,4,1"/>
              </ContentControl>
              <Path x:Name="SortIcon" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Uniform" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" Width="8" Opacity="0" RenderTransformOrigin=".5,.5" Grid.Column="1" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z ">
                <Path.RenderTransform>
                  <ScaleTransform ScaleX=".9" ScaleY=".9"/>
                </Path.RenderTransform>
              </Path>
            </Grid>
            <Rectangle x:Name="VerticalSeparator" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Stretch" Width="1" Visibility="{TemplateBinding SeparatorVisibility}" Grid.Column="1"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataGridRowHeaderStyle-->
  <Style TargetType="dataPrimitives:DataGridRowHeader">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="SeparatorVisibility" Value="Collapsed"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="dataPrimitives:DataGridRowHeader">
          <Grid x:Name="Root" Cursor="Hand">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto"/>
              <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition/>
              <RowDefinition/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="MouseOverRectangle" Storyboard.TargetProperty="Opacity" To=".25"/>
                    <DoubleAnimation  Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" To="0"/>
                    <DoubleAnimation  Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MouseOverCurrentRowSelected">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".35"/>
                    <DoubleAnimation  Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" To="1"/>
                    <DoubleAnimation  Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="NormalCurrentRow">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" To="1"/>
                    <DoubleAnimation  Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="NormalSelected">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".25"/>
                    <DoubleAnimation  Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" To="0"/>
                    <DoubleAnimation  Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="NormalEditingRow">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".35"/>
                    <DoubleAnimation  Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" To="1"/>
                    <DoubleAnimation  Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" To="0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="RowValid"/>
                <VisualState x:Name="RowInvalid">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To="0"/>
                    <DoubleAnimation  Storyboard.TargetName="RowInvalidVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                    <DoubleAnimation  Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" To=".5"/>
                    <DoubleAnimation  Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" To=".5"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Grid.ColumnSpan="2" Grid.RowSpan="3" BorderBrush="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="0,0,1,0">
              <Grid Background="Transparent">
                <Rectangle x:Name="RowInvalidVisualElement" Fill="{Binding InactiveBorderBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Opacity="0" Grid.ColumnSpan="2" Grid.RowSpan="3"/>
                <Rectangle x:Name="BackgroundShadow" Fill="{Binding WindowFrameBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Stretch="Fill" Opacity="0.05" Grid.ColumnSpan="2" Grid.RowSpan="3"/>
                <Rectangle x:Name="BackgroundRectangle" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Fill="Transparent" Stretch="Fill" Grid.ColumnSpan="2" Grid.RowSpan="3" Opacity=".15" />
                <Rectangle x:Name="MouseOverRectangle" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Grid.ColumnSpan="2" Grid.RowSpan="3" Opacity="0"/>
              </Grid>
            </Border>
            <Rectangle x:Name="HorizontalSeparator" Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Height="1" HorizontalAlignment="Stretch" Margin="1,0,1,0" Visibility="{TemplateBinding SeparatorVisibility}" Grid.ColumnSpan="2" Grid.Row="2"/>
            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.RowSpan="2" Content="{TemplateBinding Content}"/>
            <Path x:Name="CurrentRowGlyph" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="10" HorizontalAlignment="Center" Margin="8,0,8,0" VerticalAlignment="Center" Width="6" Opacity="0" Grid.RowSpan="2" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "/>
            <Path x:Name="EditingRowGlyph" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="10" HorizontalAlignment="Center" Margin="8,0,8,0" VerticalAlignment="Center" Width="6" Opacity="0" Grid.RowSpan="2" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataGridRowStyle-->
  <Style TargetType="data:DataGridRow">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="data:DataGridRow">
          <dataPrimitives:DataGridFrozenGrid x:Name="Root">
            <dataPrimitives:DataGridFrozenGrid.Resources>
              <Storyboard x:Key="DetailsVisibleTransition">
                <DoubleAnimation Duration="00:00:0.1" Storyboard.TargetName="DetailsPresenter" Storyboard.TargetProperty="ContentHeight"/>
              </Storyboard>
            </dataPrimitives:DataGridFrozenGrid.Resources>
            <dataPrimitives:DataGridFrozenGrid.ColumnDefinitions>
              <ColumnDefinition Width="Auto"/>
              <ColumnDefinition/>
            </dataPrimitives:DataGridFrozenGrid.ColumnDefinitions>
            <dataPrimitives:DataGridFrozenGrid.RowDefinitions>
              <RowDefinition/>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="Auto"/>
            </dataPrimitives:DataGridFrozenGrid.RowDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="NormalAlternatingRow">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".5"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="NormalSelected">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".35"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MouseOverSelected">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".45"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="UnfocusedSelected">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".15"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="Invalid">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation  Storyboard.TargetName="InvalidVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="BackgroundRectangle" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
            <Rectangle x:Name="InvalidVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Opacity="0" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
            <dataPrimitives:DataGridRowHeader x:Name="RowHeader" dataPrimitives:DataGridFrozenGrid.IsFrozen="True" Grid.RowSpan="3"/>
            <dataPrimitives:DataGridCellsPresenter x:Name="CellsPresenter" dataPrimitives:DataGridFrozenGrid.IsFrozen="True" Grid.Column="1"/>
            <dataPrimitives:DataGridDetailsPresenter x:Name="DetailsPresenter" Grid.Column="1" Grid.Row="1"/>
            <Rectangle x:Name="BottomGridLine" Height="0" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="2"/>
          </dataPrimitives:DataGridFrozenGrid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataGridStyle-->
  <Style TargetType="data:DataGrid">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="RowBackground"
            Binding="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" />
      </Setter.Value>
    </Setter>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="AlternatingRowBackground"
            Binding="{Binding ControlBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="BorderBrush"
            Binding="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="Foreground"
            Binding="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="HeadersVisibility" Value="Column"/>
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="SelectionMode" Value="Extended"/>
    <Setter Property="CanUserReorderColumns" Value="True"/>
    <Setter Property="CanUserResizeColumns" Value="True"/>
    <Setter Property="CanUserSortColumns" Value="True"/>
    <Setter Property="AutoGenerateColumns" Value="True"/>
    <Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="DragIndicatorStyle">
      <Setter.Value>
        <Style TargetType="ContentControl">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="ContentControl" >
                <Grid>
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="SortStates">
                      <VisualState x:Name="Unsorted"/>
                      <VisualState x:Name="SortAscending">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" To="1.0"/>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="SortDescending">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" To="1.0"/>
                          <DoubleAnimation  Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="(RenderTransform).ScaleY" To="-.9"/>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Rectangle x:Name="BackgroundRectangle" Opacity=".5" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Grid.ColumnSpan="2"/>
                  <Rectangle x:Name="BackgroundGradient" Stretch="Fill" Opacity="0" Grid.ColumnSpan="2" Fill="Transparent"/>
                  <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition/>
                      <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <ContentControl Foreground="{Binding HighlightTextBrush, Source={StaticResource SystemBrushes}}" FontFamily="{StaticResource FontF_Normal}" FontSize="{StaticResource FontS}">
                      <ContentPresenter Content="{TemplateBinding Content}"/>
                    </ContentControl>
                    <Path x:Name="SortIcon" Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Uniform" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" Width="8" Opacity="0" RenderTransformOrigin=".5,.5" Grid.Column="1" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z ">
                      <Path.RenderTransform>
                        <ScaleTransform ScaleX=".9" ScaleY=".9"/>
                      </Path.RenderTransform>
                    </Path>
                  </Grid>
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="DropLocationIndicatorStyle">
      <Setter.Value>
        <Style TargetType="ContentControl">
          <Setter Property="Width" Value="2"/>
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="ContentControl">
                <Rectangle Fill="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="GridLinesVisibility" Value="Vertical"/>
    <Setter Property="IsTabStop" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="data:DataGrid">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To=".55"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}">
              <Grid x:Name="Root" Background="Transparent">
                <Grid.Resources>
                  <ControlTemplate x:Key="TopLeftHeaderTemplate" TargetType="dataPrimitives:DataGridColumnHeader">
                    <Grid x:Name="Root">
                      <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition Height="Auto"/>
                      </Grid.RowDefinitions>
                      <Border Grid.RowSpan="2" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="0,0,1,0">
                        <Rectangle Stretch="Fill" Fill="Transparent" StrokeThickness="1"/>
                      </Border>
                      <Rectangle Fill="Transparent" StrokeThickness="1" Height="1" VerticalAlignment="Bottom" Width="Auto" Grid.RowSpan="2"/>
                    </Grid>
                  </ControlTemplate>
                  <ControlTemplate x:Key="TopRightHeaderTemplate" TargetType="dataPrimitives:DataGridColumnHeader">
                    <Grid x:Name="RootElement">
                      <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition Height="Auto"/>
                      </Grid.RowDefinitions>
                      <Border Grid.RowSpan="2" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1,0,0,0">
                        <Rectangle Stretch="Fill" Fill="Transparent"/>
                      </Border>
                    </Grid>
                  </ControlTemplate>
                </Grid.Resources>
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition/>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto"/>
                  <ColumnDefinition/>
                  <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <dataPrimitives:DataGridColumnHeader x:Name="TopLeftCornerHeader" Width="22" Template="{StaticResource TopLeftHeaderTemplate}"/>
                <dataPrimitives:DataGridColumnHeadersPresenter x:Name="ColumnHeadersPresenter" Grid.Column="1"/>
                <dataPrimitives:DataGridColumnHeader x:Name="TopRightCornerHeader" Template="{StaticResource TopRightHeaderTemplate}" Grid.Column="2"/>
                <Rectangle x:Name="ColumnHeadersAndRowsSeparator" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Height="1" VerticalAlignment="Bottom" Width="Auto" Grid.ColumnSpan="3"/>
                <dataPrimitives:DataGridRowsPresenter x:Name="RowsPresenter" Grid.ColumnSpan="2" Grid.Row="1"/>
                <Rectangle x:Name="BottomRightCorner" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Grid.Column="2" Grid.Row="2"/>
                <Rectangle x:Name="BottomLeftCorner" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Grid.ColumnSpan="2" Grid.Row="2"/>
                <ScrollBar x:Name="VerticalScrollbar" Margin="0,-1,-1,-1" Width="18" Grid.Column="2" Grid.Row="1" Orientation="Vertical"/>
                <Grid Grid.Column="1" Grid.Row="2">
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition/>
                  </Grid.ColumnDefinitions>
                  <Rectangle x:Name="FrozenColumnScrollBarSpacer"/>
                  <ScrollBar x:Name="HorizontalScrollbar" Height="18" Margin="-1,0,-1,-1" Grid.Column="1" Orientation="Horizontal"/>
                </Grid>
                <dataInput:ValidationSummary x:Name="ValidationSummary" MaxHeight="90" Grid.ColumnSpan="3" Grid.Row="3" Filter="ObjectErrors"/>
              </Grid>
            </Border>
            <Border x:Name="DisabledVisualElement" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" IsHitTestVisible="False" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" CornerRadius="0"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- *******TOOLKIT STYLES******* -->
  <!-- **************************** -->

  <!-- Expander Style -->
  <Style TargetType="controlsToolkit:Expander">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controlsToolkit:Expander">
          <Grid Background="Transparent">
            <Grid.Resources>
              <ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton">
                <Grid Background="Transparent">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CheckStates">
                      <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="00:00:00.1"/>
                      </VisualStateGroup.Transitions>
                      <VisualState x:Name="Checked">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unchecked"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                      </VisualStateGroup.Transitions>
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualStateGroup.Transitions>
                        <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                      </VisualStateGroup.Transitions>
                      <VisualState x:Name="Focused">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Border Padding="{TemplateBinding Padding}">
                    <Grid Background="Transparent">
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="19"/>
                        <ColumnDefinition Width="*"/>
                      </Grid.ColumnDefinitions>
                      <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                        <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" RadiusX="2" RadiusY="2" IsHitTestVisible="false" Opacity="0" Margin="-2"/>
                        <Rectangle x:Name="circle" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" RadiusX="2" RadiusY="2" Height="19" Width="19" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        <Path x:Name="arrow" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
                        <Border x:Name="ColorChange" CornerRadius="2"  Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
                        <Border x:Name="DisabledVisualElement" CornerRadius="2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
                      </Grid>
                      <ContentControl Grid.Column="1" TextOptions.TextHintingMode="Fixed" FontFamily="{StaticResource FontF_Bold}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5,0,0,0">
                        <ContentPresenter x:Name="header" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                      </ContentControl>
                    </Grid>
                  </Border>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton">
                <Grid Background="Transparent">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CheckStates">
                      <VisualState x:Name="Checked">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unchecked"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                      </VisualStateGroup.Transitions>
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Border Padding="{TemplateBinding Padding}">
                    <Grid Background="Transparent">
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="19"/>
                        <ColumnDefinition Width="*"/>
                      </Grid.ColumnDefinitions>
                      <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                        <Grid.RenderTransform>
                          <TransformGroup>
                            <TransformGroup.Children>
                              <TransformCollection>
                                <RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/>
                              </TransformCollection>
                            </TransformGroup.Children>
                          </TransformGroup>
                        </Grid.RenderTransform>
                        <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" RadiusX="2" RadiusY="2" IsHitTestVisible="false" Opacity="0" Margin="-2"/>
                        <Rectangle x:Name="circle" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" RadiusX="2" RadiusY="2" Height="19" Width="19" HorizontalAlignment="Center" VerticalAlignment="Center">
                          <Rectangle.RenderTransform>
                            <TransformGroup>
                              <TransformGroup.Children>
                                <TransformCollection>
                                  <RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/>
                                </TransformCollection>
                              </TransformGroup.Children>
                            </TransformGroup>
                          </Rectangle.RenderTransform>
                        </Rectangle>
                        <Path x:Name="arrow" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
                        <Border x:Name="ColorChange" CornerRadius="2" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
                        <Border x:Name="DisabledVisualElement" CornerRadius="2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
                      </Grid>
                      <ContentControl Grid.Column="1" TextOptions.TextHintingMode="Fixed" FontFamily="{StaticResource FontF_Bold}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5,0,0,0">
                        <ContentPresenter x:Name="header" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                      </ContentControl>
                    </Grid>
                  </Border>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton">
                <Grid Background="Transparent">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CheckStates">
                      <VisualState x:Name="Checked">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unchecked"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                      </VisualStateGroup.Transitions>
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".85"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".85"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Border Padding="{TemplateBinding Padding}" Margin="-4,2,0,0">
                    <Grid Background="Transparent">
                      <Grid.RowDefinitions>
                        <RowDefinition Height="19"/>
                        <RowDefinition Height="*"/>
                      </Grid.RowDefinitions>
                      <StackPanel Orientation="Horizontal">
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
                          <Grid.RenderTransform>
                            <TransformGroup>
                              <TransformGroup.Children>
                                <TransformCollection>
                                  <RotateTransform Angle="90" CenterX="9.5" CenterY="9.5"/>
                                </TransformCollection>
                              </TransformGroup.Children>
                            </TransformGroup>
                          </Grid.RenderTransform>
                          <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" RadiusX="2" RadiusY="2" IsHitTestVisible="false" Opacity="0" Margin="-2"/>
                          <Rectangle x:Name="circle" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" RadiusX="2" RadiusY="2" Height="19" Width="19" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Rectangle.RenderTransform>
                              <TransformGroup>
                                <TransformGroup.Children>
                                  <TransformCollection>
                                    <RotateTransform Angle="-90" CenterX="9.5" CenterY="9.5"/>
                                  </TransformCollection>
                                </TransformGroup.Children>
                              </TransformGroup>
                            </Rectangle.RenderTransform>
                          </Rectangle>
                          <Path x:Name="arrow" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
                          <Border x:Name="ColorChange" CornerRadius="2" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
                          <Border x:Name="DisabledVisualElement" CornerRadius="2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
                        </Grid>
                        <ContentControl TextOptions.TextHintingMode="Fixed" FontFamily="{StaticResource FontF_Bold}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0">
                          <ContentPresenter x:Name="header" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </ContentControl>
                      </StackPanel>
                    </Grid>
                  </Border>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton">
                <Grid Background="Transparent">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CheckStates">
                      <VisualState x:Name="Checked">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unchecked"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                        <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                      </VisualStateGroup.Transitions>
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".85"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".85"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Border Padding="{TemplateBinding Padding}" Margin="0,2,-4,0">
                    <Grid Background="Transparent">
                      <Grid.RowDefinitions>
                        <RowDefinition Height="19"/>
                        <RowDefinition Height="*"/>
                      </Grid.RowDefinitions>
                      <StackPanel Orientation="Horizontal">
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
                          <Grid.RenderTransform>
                            <TransformGroup>
                              <TransformGroup.Children>
                                <TransformCollection>
                                  <RotateTransform Angle="270" CenterX="9.5" CenterY="9.5"/>
                                </TransformCollection>
                              </TransformGroup.Children>
                            </TransformGroup>
                          </Grid.RenderTransform>
                          <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" RadiusX="2" RadiusY="2" IsHitTestVisible="false" Opacity="0" Margin="-2"/>
                          <Rectangle x:Name="circle" Fill="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" RadiusX="2" RadiusY="2" Height="19" Width="19" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Rectangle.RenderTransform>
                              <TransformGroup>
                                <TransformGroup.Children>
                                  <TransformCollection>
                                    <RotateTransform Angle="-270" CenterX="9.5" CenterY="9.5"/>
                                  </TransformCollection>
                                </TransformGroup.Children>
                              </TransformGroup>
                            </Rectangle.RenderTransform>
                          </Rectangle>
                          <Path x:Name="arrow" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
                          <Border x:Name="ColorChange" CornerRadius="2" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
                          <Border x:Name="DisabledVisualElement" CornerRadius="2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
                        </Grid>
                        <ContentControl Grid.Column="1" TextOptions.TextHintingMode="Fixed" FontFamily="{StaticResource FontF_Bold}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0">
                          <ContentPresenter x:Name="header" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </ContentControl>
                      </StackPanel>
                    </Grid>
                  </Border>
                </Grid>
              </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualState x:Name="Collapsed"/>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ExpandDirectionStates">
                <VisualState x:Name="ExpandDown">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandUp">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandLeft">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandRight">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderRightHeaderTemplate}"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Cursor="Hand" Margin="0,1,0,1" Padding="0,4,0,4">
              <Grid>
                <Grid.RowDefinitions>
                  <RowDefinition x:Name="rd0" Height="Auto"/>
                  <RowDefinition x:Name="rd1" Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition x:Name="cd0" Width="Auto"/>
                  <ColumnDefinition x:Name="cd1" Width="Auto"/>
                </Grid.ColumnDefinitions>
                <ToggleButton x:Name="ExpanderButton" Grid.Column="0" Grid.Row="0" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Template="{StaticResource ExpanderDownHeaderTemplate}" IsChecked="{TemplateBinding IsExpanded}" Margin="3"/>
                <Border x:Name="ExpandSite" Grid.Column="0" Grid.Row="1" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" Margin="20,0,20,-2">
                  <ContentControl TextOptions.TextHintingMode="Fixed" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="3,4,3,3" Padding="4,4,4,4"/>
                </Border>
              </Grid>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ButtonSpinner Style -->
  <Style TargetType="inputToolkit:ButtonSpinner">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:ButtonSpinner">
          <Grid>
            <Grid.Resources>
              <ControlTemplate x:Key="IncreaseButton" TargetType="RepeatButton">
                <Grid>
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverRectangle" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverRectangle" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused"/>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Rectangle x:Name="Background" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Margin="1,1,1,0" StrokeThickness="0"/>
                  <Rectangle Margin="1,1,1,0" x:Name="BackgroundGradient" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Fill="Transparent"/>
                  <Rectangle Margin="1,1,1,0" x:Name="HoverRectangle" IsHitTestVisible="false" Opacity="0" Stroke="Transparent" StrokeThickness="0" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}"/>
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Height="4" Width="8" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z"/>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="DecreaseButton" TargetType="RepeatButton">
                <Grid>
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverRectangle" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverRectangle" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused"/>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Rectangle x:Name="Background" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Margin="1,0,1,1" StrokeThickness="0"/>
                  <Rectangle Margin="1,0,1,1" x:Name="BackgroundGradient" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="0" Fill="Transparent"/>
                  <Rectangle Margin="1,0,1,1" x:Name="HoverRectangle" IsHitTestVisible="false" Opacity="0" Stroke="Transparent" StrokeThickness="0" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}"/>
                  <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Height="4" Width="8" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z"/>
                </Grid>
              </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <RepeatButton x:Name="IncreaseButton" Grid.Column="1" Template="{StaticResource IncreaseButton}" Width="15" HorizontalAlignment="Left" IsTabStop="False" Margin="0,0,0,0.5" UseLayoutRounding="False"/>
              <ContentPresenter Grid.RowSpan="2" Content="{TemplateBinding Content}"/>
              <RepeatButton x:Name="DecreaseButton" Grid.Row="1" Grid.Column="1" Template="{StaticResource DecreaseButton}" Width="15" HorizontalAlignment="Left" ClickMode="Press" IsTabStop="False" UseLayoutRounding="False" Margin="0,0.5,0,0"/>
            </Grid>
            <Border x:Name="DisabledVisualElement" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--NumericUpDown Style-->
  <Style TargetType="inputToolkit:NumericUpDown">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:NumericUpDown">
          <Grid TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualElement"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="17"/>
              </Grid.ColumnDefinitions>
              <TextBox x:Name="Text" Text="{TemplateBinding Value}" TextWrapping="NoWrap" TextAlignment="Right" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" SelectionBackground="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" SelectionForeground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Stretch" AcceptsReturn="False">
                <TextBox.Template>
                  <ControlTemplate>
                    <Grid x:Name="grid" Margin="1,2,0,2">
                      <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                          <VisualState x:Name="Normal"/>
                          <VisualState x:Name="MouseOver"/>
                          <VisualState x:Name="Disabled"/>
                          <VisualState x:Name="ReadOnly">
                            <Storyboard>
                              <DoubleAnimation  Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity" To=".25"/>
                            </Storyboard>
                          </VisualState>
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="FocusStates">
                          <VisualState x:Name="Focused">
                            <Storyboard>
                              <DoubleAnimation Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                            </Storyboard>
                          </VisualState>
                          <VisualState x:Name="Unfocused"/>
                        </VisualStateGroup>
                      </VisualStateManager.VisualStateGroups>
                      <Border x:Name="ReadOnlyVisualElement" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
                      <ScrollViewer x:Name="ContentElement" VerticalAlignment="Center" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Margin="0" Padding="0,1" IsTabStop="False"/>
                      <Border x:Name="FocusVisualElement" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" Margin="-2,-2,-18,-2" Opacity="0" IsHitTestVisible="False"/>
                    </Grid>
                  </ControlTemplate>
                </TextBox.Template>
              </TextBox>
              <Rectangle x:Name="SpinnerBlockingColor" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Grid.Column="1" Margin="0,3,2,3"/>
              <inputToolkit:ButtonSpinner x:Name="Spinner" Grid.Column="1" IsTabStop="False" Margin="0,3,2,3"/>
            </Grid>
            <Border x:Name="TextBoxBorder" Background="Transparent" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Margin="1,2" IsHitTestVisible="False"/>
            <Border x:Name="DisabledVisualElement" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Opacity="0" Margin="1,2" IsHitTestVisible="false"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- DomainUpDown -->
  <Style x:Name="DomainUpDownStyle" TargetType="inputToolkit:DomainUpDown">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="4,3,4,3"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:DomainUpDown">
          <Grid TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualElement"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="17"/>
              </Grid.ColumnDefinitions>
              <TextBox x:Name="Text" Text="{TemplateBinding Value}" TextWrapping="NoWrap" TextAlignment="Right" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" SelectionBackground="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" SelectionForeground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Stretch" AcceptsReturn="False">
                <TextBox.Template>
                  <ControlTemplate>
                    <Grid x:Name="grid" Margin="1,2,0,2">
                      <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                          <VisualState x:Name="Normal"/>
                          <VisualState x:Name="MouseOver"/>
                          <VisualState x:Name="Disabled"/>
                          <VisualState x:Name="ReadOnly">
                            <Storyboard>
                              <DoubleAnimation  Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity" To=".25"/>
                            </Storyboard>
                          </VisualState>
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="FocusStates">
                          <VisualState x:Name="Focused">
                            <Storyboard>
                              <DoubleAnimation Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                            </Storyboard>
                          </VisualState>
                          <VisualState x:Name="Unfocused"/>
                        </VisualStateGroup>
                      </VisualStateManager.VisualStateGroups>
                      <Border x:Name="ReadOnlyVisualElement" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
                      <ScrollViewer x:Name="ContentElement" VerticalAlignment="Center" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Margin="0" Padding="0,1" IsTabStop="False"/>
                      <Border x:Name="FocusVisualElement" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" Margin="-2,-2,-18,-2" Opacity="0" IsHitTestVisible="False"/>
                    </Grid>
                  </ControlTemplate>
                </TextBox.Template>
              </TextBox>
              <Rectangle x:Name="SpinnerBlockingColor" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Grid.Column="1" Margin="0,3,2,3"/>
              <inputToolkit:ButtonSpinner x:Name="Spinner" Grid.Column="1" IsTabStop="False" Margin="0,3,2,3"/>
            </Grid>
            <Border x:Name="TextBoxBorder" Background="Transparent" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Margin="1,2" IsHitTestVisible="False"/>
            <Border x:Name="DisabledVisualElement" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Opacity="0" Margin="1,2" IsHitTestVisible="false"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--TimeUpDown-->
  <Style TargetType="inputToolkit:TimeUpDown">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="4,3,4,3"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:TimeUpDown">
          <Grid TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="TimeHintStates">
                <VisualState x:Name="TimeHintOpenedUp">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="-23" KeySpline="0,0,0,1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Height">
                      <DiscreteDoubleKeyFrame KeyTime="0" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="22" KeySpline="0,0,0,1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="TimeHintOpenedDown">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" KeySpline="0,0,0,1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Height">
                      <DiscreteDoubleKeyFrame KeyTime="0" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="22" KeySpline="0,0,0,1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="TimeHintClosed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="00:00:2" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" KeySpline="0,0,0,1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Height">
                      <DiscreteDoubleKeyFrame KeyTime="0" Value="22"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" KeySpline="0,0,0,1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ParsingStates">
                <VisualState x:Name="ValidTime"/>
                <VisualState x:Name="InvalidTime"/>
                <VisualState x:Name="EmptyTime"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Popup x:Name="TimeHintPopup" IsOpen="True" VerticalOffset="0">
              <Border x:Name="TimeHintVisualElement" HorizontalAlignment="Stretch" IsHitTestVisible="True" Visibility="Collapsed" Background="{Binding ActiveCaptionBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                <Border.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                  </TransformGroup>
                </Border.RenderTransform>
                <Grid>
                  <ContentControl Content="{TemplateBinding TimeHintContent}" TextOptions.TextHintingMode="Fixed" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Foreground="{Binding ActiveCaptionTextBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="3" IsTabStop="False" IsHitTestVisible="False"/>
                </Grid>
              </Border>
            </Popup>
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="17"/>
              </Grid.ColumnDefinitions>
              <TextBox x:Name="Text" Text="{TemplateBinding Value}" TextWrapping="NoWrap" TextAlignment="Right" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" SelectionBackground="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" SelectionForeground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Stretch" AcceptsReturn="False">
                <TextBox.Template>
                  <ControlTemplate>
                    <Grid x:Name="grid" Margin="1,2,0,2">
                      <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                          <VisualState x:Name="Normal"/>
                          <VisualState x:Name="MouseOver"/>
                          <VisualState x:Name="Disabled"/>
                          <VisualState x:Name="ReadOnly">
                            <Storyboard>
                              <DoubleAnimation  Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity" To=".25"/>
                            </Storyboard>
                          </VisualState>
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="FocusStates">
                          <VisualState x:Name="Focused">
                            <Storyboard>
                              <DoubleAnimation Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                            </Storyboard>
                          </VisualState>
                          <VisualState x:Name="Unfocused"/>
                        </VisualStateGroup>
                      </VisualStateManager.VisualStateGroups>
                      <Border x:Name="ReadOnlyVisualElement" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
                      <ScrollViewer x:Name="ContentElement" VerticalAlignment="Center" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Margin="0" Padding="0,1" IsTabStop="False"/>
                      <Border x:Name="FocusVisualElement" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" Margin="-2,-2,-18,-2" Opacity="0" IsHitTestVisible="False"/>
                    </Grid>
                  </ControlTemplate>
                </TextBox.Template>
              </TextBox>
              <Rectangle x:Name="SpinnerBlockingColor" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Grid.Column="1" Margin="0,3,2,3"/>
              <inputToolkit:ButtonSpinner x:Name="Spinner" Grid.Column="1" IsTabStop="False" Margin="0,3,2,3"/>
            </Grid>
            <Border x:Name="TextBoxBorder" Background="Transparent" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Margin="1,2" IsHitTestVisible="False"/>
            <Border x:Name="DisabledVisualElement" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Opacity="0" Margin="1,2" IsHitTestVisible="false"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ListTimePickerPopup Style -->
  <Style TargetType="inputToolkit:ListTimePickerPopup">
    <Setter Property="PopupMinutesInterval" Value="30"/>
    <Setter Property="PopupSecondsInterval" Value="0"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:ListTimePickerPopup">
          <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ContainedByPickerStates">
                <VisualState x:Name="Contained"/>
                <VisualState x:Name="NotContained"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="PopupModeStates">
                <VisualState x:Name="AllowSecondsAndDesignatorsSelection"/>
                <VisualState x:Name="AllowTimeDesignatorsSelection"/>
                <VisualState x:Name="AllowSecondsSelection"/>
                <VisualState x:Name="HoursAndMinutesOnly"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ListBox x:Name="ListBox" IsTabStop="True" TabIndex="1" MaxHeight="130" DisplayMemberPath="Key" DataContext="{TemplateBinding TimeItemsSelection}" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--TimePicker-->
  <Style TargetType="inputToolkit:TimePicker">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="PopupTemplate">
      <Setter.Value>
        <inputToolkit:TimePickerPopupTemplate>
          <inputToolkit:ListTimePickerPopup/>
        </inputToolkit:TimePickerPopupTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:TimePicker">
          <Grid TextOptions.TextHintingMode="Fixed">
            <Grid.Resources>
              <ControlTemplate x:Key="PopupButtonTemplate" TargetType="ToggleButton">
                <Grid Height="20" Width="20" Margin="0,1,0,0" Cursor="Hand">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverEllipse" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".5"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Pressed">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverEllipse" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".75"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                            <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Ellipse Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Margin=".25,.25,1,2"/>
                  <Ellipse x:Name="MouseOverEllipse" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0" Stroke="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Margin=".25,.25,1,2"/>
                  <Ellipse x:Name="DisabledVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="1" Margin=".25,.25,1,2" Opacity="0"/>
                  <Path Fill="Transparent" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Height="8.258" Stretch="Fill" VerticalAlignment="Top" Margin="8.375,5.24,6.625,0" Data="M10.108397,6.5404582 L10.108397,10.415268 L13.538931,13.738435"/>
                  <Ellipse Fill="Transparent" Margin="8.406,9.438,9.594,10.562"/>
                </Grid>
              </ControlTemplate>
              <ControlTemplate x:Key="TimeUpDownInternalStyle" TargetType="inputToolkit:TimeUpDown">
                <Grid TextOptions.TextHintingMode="Fixed">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver"/>
                      <VisualState x:Name="Pressed"/>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimation To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused"/>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="TimeHintStates">
                      <VisualState x:Name="TimeHintOpenedUp">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                          </ObjectAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="-23" KeySpline="0,0,0,1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Height">
                            <DiscreteDoubleKeyFrame KeyTime="0" Value="0"/>
                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="22" KeySpline="0,0,0,1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="TimeHintOpenedDown">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                          </ObjectAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" KeySpline="0,0,0,1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Height">
                            <DiscreteDoubleKeyFrame KeyTime="0" Value="0"/>
                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="22" KeySpline="0,0,0,1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="TimeHintClosed">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="00:00:2" Value="Collapsed"/>
                          </ObjectAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" KeySpline="0,0,0,1"/>
                          </DoubleAnimationUsingKeyFrames>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TimeHintVisualElement" Storyboard.TargetProperty="Height">
                            <DiscreteDoubleKeyFrame KeyTime="0" Value="22"/>
                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" KeySpline="0,0,0,1"/>
                          </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="ParsingStates">
                      <VisualState x:Name="ValidTime"/>
                      <VisualState x:Name="InvalidTime"/>
                      <VisualState x:Name="EmptyTime"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Popup x:Name="TimeHintPopup" IsOpen="True" VerticalOffset="0" Margin="3,0,0,0">
                    <Border x:Name="TimeHintVisualElement" HorizontalAlignment="Stretch" IsHitTestVisible="True" Visibility="Collapsed" Background="{Binding ActiveCaptionBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
                      <Border.RenderTransform>
                        <TransformGroup>
                          <ScaleTransform/>
                          <SkewTransform/>
                          <RotateTransform/>
                          <TranslateTransform/>
                        </TransformGroup>
                      </Border.RenderTransform>
                      <Grid>
                        <ContentControl Content="{TemplateBinding TimeHintContent}" TextOptions.TextHintingMode="Fixed" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Foreground="{Binding ActiveCaptionTextBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="3" IsTabStop="False" IsHitTestVisible="False"/>
                      </Grid>
                    </Border>
                  </Popup>
                  <Border x:Name="TextBoxBackground" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Margin="3,0,1,0" IsHitTestVisible="False"/>
                  <Grid Margin="2,0,0,0">
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="*"/>
                      <ColumnDefinition Width="17"/>
                    </Grid.ColumnDefinitions>
                    <TextBox x:Name="Text" Text="{TemplateBinding Value}" TextWrapping="NoWrap" TextAlignment="Right" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" SelectionBackground="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" SelectionForeground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Stretch" AcceptsReturn="False" Padding="2">
                      <TextBox.Template>
                        <ControlTemplate>
                          <Grid x:Name="grid" Margin="1,0,0,0">
                            <VisualStateManager.VisualStateGroups>
                              <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="ReadOnly">
                                  <Storyboard>
                                    <DoubleAnimation  Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity" To=".25"/>
                                  </Storyboard>
                                </VisualState>
                              </VisualStateGroup>
                              <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                  <Storyboard>
                                    <DoubleAnimation Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                                  </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                              </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="ReadOnlyVisualElement" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
                            <ScrollViewer x:Name="ContentElement" VerticalAlignment="Center" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Margin="0" Padding="0,1,0,1" IsTabStop="False"/>
                            <Border x:Name="FocusVisualElement" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" Margin="-2,-2,-18,-2" Opacity="0" IsHitTestVisible="False"/>
                          </Grid>
                        </ControlTemplate>
                      </TextBox.Template>
                    </TextBox>
                    <Rectangle x:Name="SpinnerBlockingColor" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Grid.Column="1" Margin="0,1,2,1"/>
                    <inputToolkit:ButtonSpinner x:Name="Spinner" Grid.Column="1" IsTabStop="False" Margin="0,1,2,1"/>
                  </Grid>
                  <Border x:Name="TextBoxBorder" Background="Transparent" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Margin="3,0,1,0" IsHitTestVisible="False"/>
                  <Border x:Name="DisabledVisualElement" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Opacity="0" Margin="1,2" IsHitTestVisible="false"/>
                </Grid>
              </ControlTemplate>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="PopupStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0:0:0.1" To="PopupOpened"/>
                  <VisualTransition GeneratedDuration="0:0:0.2" To="PopupClosed"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="PopupOpened">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PopupRoot" Storyboard.TargetProperty="Opacity" To="1.0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="PopupClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PopupRoot" Storyboard.TargetProperty="Opacity" To="0.0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <inputToolkit:TimeUpDown x:Name="TimeUpDown" Padding="0" Grid.Column="0" Template="{StaticResource TimeUpDownInternalStyle}" SpinnerStyle="{TemplateBinding SpinnerStyle}" Culture="{TemplateBinding Culture}" Format="{TemplateBinding Format}" TimeGlobalizationInfo="{TemplateBinding TimeGlobalizationInfo}" TimeParsers="{TemplateBinding TimeParsers}" VerticalContentAlignment="Stretch" Margin="-2"/>
            <ToggleButton x:Name="DropDownToggle" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,0,0" Template="{StaticResource PopupButtonTemplate}"/>
            <Popup x:Name="Popup" Margin="1,2,0,0">
              <Border x:Name="PopupRoot" BorderBrush="Transparent" Background="Transparent" BorderThickness="0" Margin="0,-3,0,0" Padding="0,0,25,0">
                <ContentControl x:Name="PopupPlaceHolder" TextOptions.TextHintingMode="Fixed" HorizontalContentAlignment="Stretch" IsTabStop="False" VerticalContentAlignment="Stretch"/>
              </Border>
            </Popup>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--AccordionButton-->
  <Style TargetType="layoutPrimitivesToolkit:AccordionButton">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="IsTabStop" Value="True"/>
    <Setter Property="TabNavigation" Value="Once"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="layoutPrimitivesToolkit:AccordionButton">
          <Grid x:Name="grid" Background="Transparent" Margin="2" RenderTransformOrigin=".5,.5">
            <Grid.RenderTransform>
              <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
              </TransformGroup>
            </Grid.RenderTransform>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpandDirectionStates">
                <VisualState x:Name="ExpandDown">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation Storyboard.TargetName="arrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="-90"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandUp">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="90"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandLeft">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="LayoutTransform">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <TransformGroup>
                            <RotateTransform Angle="90"/>
                          </TransformGroup>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="0"/>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundHorizontal" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundVertical" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandRight">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="icon" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="header" Storyboard.TargetProperty="LayoutTransform">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <TransformGroup>
                            <RotateTransform Angle="-90"/>
                          </TransformGroup>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="180"/>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundHorizontal" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundVertical" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="icon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="icon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="90"/>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandedBackground" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.075"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CheckStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="00:00:00"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Checked"/>
                <VisualState x:Name="Unchecked"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".7"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBackground" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".2"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBackground" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".5"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="FocusVisualElement" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="3" CornerRadius="2" IsHitTestVisible="false" Opacity="0" Margin="-2"/>
            <Border x:Name="BackgroundVertical" Background="{Binding ButtonGradient_Horizontal, Source={StaticResource SystemBrushes}}" Opacity="0" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2"/>
            <Border x:Name="BackgroundHorizontal" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2"/>
            <Border x:Name="Content">
              <Grid>
                <Border x:Name="ExpandedBackground" Margin="0" VerticalAlignment="Stretch" Opacity="0" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                <Border x:Name="MouseOverBackground" Margin="0" VerticalAlignment="Stretch" Opacity="0" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                <Grid Background="Transparent" Margin="0">
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition x:Name="cd0" Width="Auto"/>
                    <ColumnDefinition x:Name="cd1" Width="Auto"/>
                  </Grid.ColumnDefinitions>
                  <Grid.RowDefinitions>
                    <RowDefinition x:Name="rd0" Height="Auto"/>
                    <RowDefinition x:Name="rd1" Height="Auto"/>
                  </Grid.RowDefinitions>
                  <Grid x:Name="icon" Grid.Column="0" Grid.Row="0" Height="19" Width="19" Margin="3" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin=".5,.5">
                    <Grid.RenderTransform>
                      <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="-90"/>
                        <TranslateTransform/>
                      </TransformGroup>
                    </Grid.RenderTransform>
                    <Path x:Name="arrow" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" Height="Auto" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="Auto" RenderTransformOrigin="0.5,0.5" Data="M 1,1.5 L 4.5,5 L 8,1.5">
                      <Path.RenderTransform>
                        <TransformGroup>
                          <ScaleTransform/>
                          <SkewTransform/>
                          <RotateTransform/>
                          <TranslateTransform/>
                        </TransformGroup>
                      </Path.RenderTransform>
                    </Path>
                  </Grid>
                  <layoutToolkit:LayoutTransformer x:Name="header" TextOptions.TextHintingMode="Fixed" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Margin="5,3" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1"/>
                </Grid>
              </Grid>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--AccordionItem-->
  <Style TargetType="layoutToolkit:AccordionItem">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Margin" Value="0"/>
    <Setter Property="Padding" Value="1"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="layoutToolkit:AccordionItem">
          <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)">
                      <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00.3" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)">
                      <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="LockedStates">
                <VisualState x:Name="Locked">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unlocked">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ExpandDirectionStates">
                <VisualState x:Name="ExpandDown">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandUp">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Thickness>0</Thickness>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandLeft">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.RowSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.RowSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ExpandRight">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.RowSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.RowSpan)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Background" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
              <Grid x:Name="grid" Margin="0">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition x:Name="cd0" Width="Auto"/>
                  <ColumnDefinition x:Name="cd1" Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                  <RowDefinition x:Name="rd0" Height="Auto"/>
                  <RowDefinition x:Name="rd1" Height="Auto"/>
                </Grid.RowDefinitions>
                <layoutPrimitivesToolkit:AccordionButton x:Name="ExpanderButton" Background="{TemplateBinding Background}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="True" Padding="0" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Row="0" IsChecked="{TemplateBinding IsSelected}" BorderThickness="0" Cursor="Hand" Canvas.ZIndex="1"/>
                <layoutPrimitivesToolkit:ExpandableContentControl x:Name="ExpandSite" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="0" Style="{TemplateBinding ExpandableContentControlStyle}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" Percentage="0" RevealMode="{TemplateBinding ExpandDirection}"/>
              </Grid>
            </Border>
            <Border x:Name="DisabledVisualElement" BorderBrush="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" Padding="0" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--AccordionStyle-->
  <Style TargetType="layoutToolkit:Accordion">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="VerticalAlignment" Value="Top"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Cursor" Value="Arrow"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Padding" Value="2"/>
    <Setter Property="Margin" Value="0"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="TabNavigation" Value="Once"/>
    <Setter Property="ItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <StackPanel VerticalAlignment="Top"/>
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="layoutToolkit:Accordion">
          <Grid x:Name="Root" Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Border" Background="Transparent" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" CornerRadius="2">
              <ScrollViewer Margin="0" Background="Transparent" TextOptions.TextHintingMode="Fixed" BorderBrush="Transparent" BorderThickness="0" IsTabStop="False" Padding="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled">
                <ItemsPresenter/>
              </ScrollViewer>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--RatingItemStyle-->
  <Style TargetType="inputToolkit:RatingItem">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:RatingItem">
          <Grid Width="20" Margin="0,0,1,0">
            <Grid.RowDefinitions>
              <RowDefinition Height="20"/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="00:00:00.2"/>
                  <VisualTransition From="MouseOver" GeneratedDuration="00:00:00.2" To="Normal"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverRatingItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value=".35"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="PressedRatingItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.39"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledRatingItem" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledRatingItemBackground" Storyboard.TargetProperty="Opacity">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ReadOnly">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ReadOnlyRatingItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="00:00:00.1000000"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard/>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FillStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="00:00:00.1000000"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Empty"/>
                <VisualState x:Name="Partial"/>
                <VisualState x:Name="Filled"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Path x:Name="DefaultRatingItem" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" StrokeLineJoin="Round" StrokeThickness=".4" VerticalAlignment="Stretch" Opacity="1" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            <inputToolkitPrimitives:LinearClipper RatioVisible="{TemplateBinding DisplayValue}" ExpandDirection="Right">
              <Path Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" StrokeLineJoin="Round" VerticalAlignment="Stretch" Opacity="1" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            </inputToolkitPrimitives:LinearClipper>
            <Path x:Name="MouseOverRatingItem" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" StrokeLineJoin="Round" VerticalAlignment="Stretch" Opacity="0" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            <Path x:Name="PressedRatingItem" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" StrokeLineJoin="Round" VerticalAlignment="Stretch" Opacity="0" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            <Path x:Name="FocusRatingItem" Stretch="Fill" Stroke="{Binding ActiveaptionBrush, Source={StaticResource SystemBrushes}}" StrokeLineJoin="Round" StrokeThickness=".01" VerticalAlignment="Stretch" Opacity="0" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            <Path x:Name="ReadOnlyRatingItem" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Stroke="{TemplateBinding BorderBrush}" StrokeLineJoin="Round" StrokeThickness=".4" VerticalAlignment="Stretch" IsHitTestVisible="False" Opacity="0" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            <Path x:Name="DisabledRatingItemBackground" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" StrokeLineJoin="Round" VerticalAlignment="Stretch" Opacity="0" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            <inputToolkitPrimitives:LinearClipper x:Name="DisabledRatingItem" Opacity="0" RatioVisible="{TemplateBinding DisplayValue}" ExpandDirection="Right">
              <Path Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" StrokeLineJoin="Round" VerticalAlignment="Stretch" Opacity="1" UseLayoutRounding="False" Data="M15,0 L18.6,11.373603 L30,11.459046 L20.824955,18.573566 L24.270519,30 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
            </inputToolkitPrimitives:LinearClipper>
            <ContentPresenter x:Name="Content" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" Grid.Row="1" Grid.RowSpan="2" ContentTemplate="{TemplateBinding ContentTemplate}"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--RatingStyle-->
  <Style TargetType="inputToolkit:Rating">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="ItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <StackPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:Rating">
          <Grid x:Name="Root" >
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver"/>
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="Disabled"/>
                <VisualState x:Name="ReadOnly">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.03"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Background="{TemplateBinding Background}">
              <ItemsPresenter/>
            </Border>
            <Border x:Name="ReadOnlyVisualElement" IsHitTestVisible="False" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}"/>
            <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}"/>
            <Rectangle x:Name="FocusVisualElement" StrokeThickness="1" RadiusX="1" RadiusY="1" IsHitTestVisible="false" Visibility="Collapsed"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataFieldStyle-->
  <Style TargetType="dataFormToolkit:DataField">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Margin" Value="3"/>
    <Setter Property="MinHeight" Value="28"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="dataFormToolkit:DataField">
          <ContentControl x:Name="ContentControl" TextOptions.TextHintingMode="Fixed" VerticalAlignment="Center" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalContentAlignment="Stretch" IsTabStop="False"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DescriptionViewerStyle-->
  <Style TargetType="dataInput:DescriptionViewer">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="GlyphTemplate">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Grid Margin="-1,-14,-1,-14" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" To="1"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" To="1"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="Icon" Height="13" Width="13" Margin="2,0,5,0" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity=".6">
              <Ellipse Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"/>
              <StackPanel Width="3" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Path Stretch="Fill" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stroke="Transparent" Height="9" Width="3" HorizontalAlignment="Center" Margin="0,0,0,1" VerticalAlignment="Top" Data="M0.5,0.60000002 C0.5,0.54477155 0.54477155,0.5 0.60000002,0.5 L2.4000001,0.5 C2.4552286,0.5 2.5,0.54477155 2.5,0.60000002 L2.5,1.6215254 C2.5,1.6767539 2.4552286,1.7215254 2.4000001,1.7215254 L0.60000002,1.7215254 C0.54477155,1.7215254 0.5,1.6767539 0.5,1.6215254 z M0.50000548,3.3151906 C0.50000548,3.2599623 0.54477704,3.2151906 0.60000551,3.2151906 L2.4000056,3.2151906 C2.4552341,3.2151906 2.5000055,3.2599623 2.5000055,3.3151906 L2.5000055,8.4000092 C2.5000055,8.4552374 2.4552341,8.5000095 2.4000056,8.5000095 L0.60000551,8.5000095 C0.54477704,8.5000095 0.50000548,8.4552374 0.50000548,8.4000092 z"/>
              </StackPanel>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ToolTipStyle">
      <Setter.Value>
        <Style TargetType="ToolTip">
          <Setter Property="Placement" Value="Right"/>
          <Setter Property="IsHitTestVisible" Value="True"/>
          <Setter Property="MaxWidth" Value="250"/>
          <Setter Property="Margin" Value="5,-3,5,0"/>
          <Setter Property="ContentTemplate">
            <Setter.Value>
              <DataTemplate>
                <TextBlock Text="{Binding}" TextWrapping="Wrap"/>
              </DataTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="dataInput:DescriptionViewer">
          <StackPanel Orientation="Horizontal">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="DescriptionStates">
                <VisualState x:Name="NoDescription"/>
                <VisualState x:Name="HasDescription">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DescriptionContent" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"  Background="{Binding ActiveCaptionBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" Padding="{TemplateBinding Padding}">
              <Button x:Name="DescriptionContent" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" IsTabStop="False" Padding="1" Template="{TemplateBinding GlyphTemplate}">
                <ToolTipService.ToolTip>
                  <ToolTip Style="{TemplateBinding ToolTipStyle}" Content="{TemplateBinding Description}" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"/>
                </ToolTipService.ToolTip>
              </Button>
            </Border>
          </StackPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--Busy Indicator-->
  <Style TargetType="controlsToolkit:BusyIndicator">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="Foreground"
            Binding="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="BusyContent" Value="Please wait..."/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="OverlayStyle">
      <Setter.Value>
        <Style TargetType="Rectangle">
          <Setter Property="Fill" Value="White"/>
          <Setter Property="Opacity" Value="0.5"/>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Width" Value="200"/>
    <Setter Property="DisplayAfter" Value="00:00:00.1"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="controlsToolkit:BusyIndicator">
          <Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="VisibilityStates">
                <VisualState x:Name="Hidden">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="busycontent">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="overlay">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Visible">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="busycontent">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="overlay">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="BusyStatusStates">
                <VisualState x:Name="Idle">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="content">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>True</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Busy">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="content">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <sys:Boolean>False</sys:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border BorderThickness="1" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" CornerRadius="2">
              <Border.Effect>
                <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="10" Opacity="0.2"/>
              </Border.Effect>
              <Grid TextOptions.TextHintingMode="Fixed">
                <ContentControl x:Name="content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                <Rectangle x:Name="overlay" Style="{TemplateBinding OverlayStyle}"/>
                <ContentPresenter x:Name="busycontent">
                  <Grid>
                    <Grid.RowDefinitions>
                      <RowDefinition Height="Auto"/>
                      <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <ProgressBar Grid.Row="1" IsIndeterminate="True" Height="10" Margin="12,0,15,12">
                      <ProgressBar.Style>
                        <Style TargetType="ProgressBar">
                        <Setter Property="Maximum" Value="100"/>
                        <Setter Property="IsTabStop" Value="False"/>
                        <Setter Property="Template">
                          <Setter.Value>
                            <ControlTemplate TargetType="ProgressBar">
                              <Grid x:Name="Root" Height="10">
                                <VisualStateManager.VisualStateGroups>
                                  <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Determinate"/>
                                    <VisualState x:Name="Indeterminate">
                                      <Storyboard RepeatBehavior="Forever">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateRoot" Storyboard.TargetProperty="Visibility">
                                          <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                              <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                          </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeterminateRoot" Storyboard.TargetProperty="Visibility">
                                          <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                              <Visibility>Collapsed</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                          </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateGradientFill" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.Transform).(TransformGroup.Children)[0].X">
                                          <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                          <SplineDoubleKeyFrame KeyTime="00:00:.5" Value="20"/>
                                        </DoubleAnimationUsingKeyFrames>
                                      </Storyboard>
                                    </VisualState>
                                  </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border x:Name="ProgressBarTrack" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="4"/>
                                <Grid x:Name="ProgressBarRootGrid">
                                  <Grid x:Name="IndeterminateRoot" Visibility="Collapsed">
                                    <Rectangle x:Name="IndeterminateSolidFill" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Margin="1" Opacity="1" RenderTransformOrigin="0.5,0.5" RadiusX="4" RadiusY="4"/>
                                    <Rectangle x:Name="IndeterminateGradientFill" Margin="1" Opacity="0.75" RadiusX="4" RadiusY="4">
                                      <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0,1" StartPoint="20,1" MappingMode="Absolute" SpreadMethod="Repeat">
                                          <LinearGradientBrush.Transform>
                                            <TransformGroup>
                                              <TranslateTransform X="0"/>
                                              <SkewTransform AngleX="-30"/>
                                            </TransformGroup>
                                          </LinearGradientBrush.Transform>
                                          <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                          <GradientStop Color="#00FFFFFF" Offset=".25"/>
                                          <GradientStop Color="#FFFFFFFF" Offset="0.85"/>
                                        </LinearGradientBrush>
                                      </Rectangle.Fill>
                                    </Rectangle>
                                  </Grid>
                                  <Grid x:Name="DeterminateRoot" Margin="1">
                                    <Rectangle x:Name="ProgressBarIndicator" Fill="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" RadiusX="4" RadiusY="4"/>
                                  </Grid>
                                </Grid>
                              </Grid>
                            </ControlTemplate>
                          </Setter.Value>
                        </Setter>
                      </Style>
                      </ProgressBar.Style>
                    </ProgressBar>
                    <ContentPresenter ContentTemplate="{TemplateBinding BusyContentTemplate}" Content="{TemplateBinding BusyContent}" Margin="12,12,12,8" HorizontalAlignment="Left"/>
                  </Grid>
                </ContentPresenter>
              </Grid>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataForm ValidationSummary Style-->
  <Style TargetType="dataInput:ValidationSummary">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="HeaderTemplate">
      <Setter.Value>
        <DataTemplate>
          <Border x:Name="Header" Margin="0,-1,0,0" Background="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2">
            <StackPanel Margin="6,2,6,4" VerticalAlignment="Top" Orientation="Horizontal">
              <Grid Height="13" Width="13">
                <Ellipse Margin="0" RenderTransformOrigin="0.5,0.5" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Stroke="{Binding ControlLightBrush, Source={StaticResource SystemBrushes}}"/>
                <Path Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Data="M5.5,2.5 L7.5,2.5 L7.5,8 L5.5,8 M5.5,9.5 L7.5,9.5 L7.5,10.5 L5.5,10.5"/>
              </Grid>
              <TextBlock FontWeight="Bold" TextOptions.TextHintingMode="Fixed" Foreground="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" Padding="4,1,0,0" Text="{Binding}"/>
            </StackPanel>
          </Border>
        </DataTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ErrorStyle">
      <Setter.Value>
        <Style TargetType="ListBoxItem">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="ListBoxItem">
                <Grid Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal"/>
                      <VisualState x:Name="MouseOver">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="FillColor" Storyboard.TargetProperty="Opacity" To=".05"/>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Disabled">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Opacity" To=".55"/>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="SelectionStates">
                      <VisualState x:Name="Unselected"/>
                      <VisualState x:Name="Selected">
                        <Storyboard>
                          <DoubleAnimation  Storyboard.TargetName="FillColor2" Storyboard.TargetProperty="Opacity" To=".15"/>
                        </Storyboard>
                      </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                      <VisualState x:Name="Focused">
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </VisualState>
                      <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>
                  <Rectangle x:Name="FillColor" Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
                  <Rectangle x:Name="FillColor2" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="False" Opacity="0"/>
                  <ContentPresenter x:Name="ContentPresenter" TextOptions.TextHintingMode="Fixed" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                  <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="2" Visibility="Collapsed"/>
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="dataInput:ValidationSummary">
          <Grid x:Name="ValidationSummary" Margin="10,0,10,0">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value=".45"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Empty">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="HasErrors"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Content" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1">
              <Grid>
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ListBox x:Name="SummaryListBox" BorderThickness="0" Foreground="{TemplateBinding Foreground}" Padding="{TemplateBinding Padding}" Grid.Row="1" ItemContainerStyle="{TemplateBinding ErrorStyle}">
                  <ListBox.ItemTemplate>
                    <DataTemplate>
                      <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="4,0,0,0" FontWeight="Bold" Text="{Binding MessageHeader}" FontFamily="{StaticResource FontF_Normal}" FontSize="{StaticResource FontS}" Foreground="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding Message}"  FontFamily="{StaticResource FontF_Normal}" FontSize="{StaticResource FontS}" Foreground="{Binding WindowTextBrush, Source={StaticResource SystemBrushes}}"/>
                      </StackPanel>
                    </DataTemplate>
                  </ListBox.ItemTemplate>
                </ListBox>
                <Border x:Name="DisabledVisual" IsHitTestVisible="True" Visibility="Collapsed" Grid.RowSpan="2" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
                <ContentControl x:Name="HeaderContentControl" HorizontalContentAlignment="Stretch" IsTabStop="False" VerticalContentAlignment="Center" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
              </Grid>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataFormButtonStyle-->
  <Style x:Key="DataFormButtonStyle" TargetType="Button">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Padding" Value="3"/>
    <Setter Property="MinHeight" Value="30"/>
    <Setter Property="MinWidth" Value="29"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Grid Margin="0,3,3,3" Cursor="Hand">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".65"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".45"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="FocusVisualElement" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" CornerRadius="1" Margin="0" IsHitTestVisible="false" Opacity="0"/>
            <Border x:Name="Background" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" CornerRadius="1">
              <Grid Margin="1" Background="Transparent">
                <Border x:Name="BackgroundAnimation" Opacity="0" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="1"/>
              </Grid>
            </Border>
            <ContentPresenter x:Name="contentPresenter" TextOptions.TextHintingMode="Fixed" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="DataFormActionButtonStyle" TargetType="Button">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Grid Cursor="Hand" TextOptions.TextHintingMode="Fixed">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".20"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ColorChange" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="FocusVisualElement" Stroke="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" StrokeThickness="3" Margin="-2" Opacity="0" IsHitTestVisible="false" RadiusX="2" RadiusY="2"/>
            <Border x:Name="Background" Background="{Binding ButtonGradient, Source={StaticResource SystemBrushes}}" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="1" CornerRadius="2">
              <Border x:Name="ColorChange" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" Opacity="0"/>
            </Border>
            <ContentControl x:Name="contentControl" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Center" VerticalAlignment="Center">
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,3"/>
            </ContentControl>
            <Rectangle x:Name="DisabledVisualElement" Fill="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" IsHitTestVisible="false" Opacity="0" RadiusX="2"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--DataFormStyle-->
  <Style TargetType="dataFormToolkit:DataForm">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="systemColors:SetterValueBindingHelper.PropertyBinding">
      <Setter.Value>
        <systemColors:SetterValueBindingHelper
            Property="Background"
            Binding="{Binding ControlBrush, Source={StaticResource SystemBrushes}}"/>
      </Setter.Value>
    </Setter>
    <Setter Property="AutoCommit" Value="False"/>
    <Setter Property="AutoGenerateFields" Value="True"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="DescriptionViewerPosition" Value="Auto"/>
    <Setter Property="LabelPosition" Value="Auto"/>
    <Setter Property="HeaderVisibility" Value="Visible"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="dataFormToolkit:DataForm">
          <Grid dataFormToolkit:DataField.IsFieldGroup="True">
            <Grid.Resources>
              <Style x:Key="ButtonGeneric" TargetType="Button">
                <Setter Property="BorderBrush" Value="Transparent"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Padding" Value="1"/>
                <Setter Property="Width" Value="10"/>
                <Setter Property="Height" Value="10"/>
                <Setter Property="Template">
                  <Setter.Value>
                    <ControlTemplate TargetType="Button">
                      <Grid>
                        <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                              <Storyboard>
                                <DoubleAnimation  Storyboard.TargetName="InnerBtnBorder" Storyboard.TargetProperty="Opacity" To=".55"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Pressed">
                              <Storyboard>
                                <DoubleAnimation  Storyboard.TargetName="InnerBtnBorder" Storyboard.TargetProperty="Opacity" To=".65"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled">
                              <Storyboard>
                                <DoubleAnimation  Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" To="0.3"/>
                              </Storyboard>
                            </VisualState>
                          </VisualStateGroup>
                          <VisualStateGroup x:Name="FocusStates">
                            <VisualStateGroup.Transitions>
                              <VisualTransition From="Unfocused" GeneratedDuration="0:0:1" To="Focused"/>
                            </VisualStateGroup.Transitions>
                            <VisualState x:Name="Focused">
                              <Storyboard>
                                <DoubleAnimation  Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                              </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Unfocused"/>
                          </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBtnBorder" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" BorderBrush="Transparent" BorderThickness="0" CornerRadius="0">
                          <Border x:Name="InnerBtnBorder" Background="{Binding HighlightBrush, Source={StaticResource SystemBrushes}}" BorderBrush="Transparent" BorderThickness="0" CornerRadius="0">
                            <ContentPresenter x:Name="contentPresenter" TextOptions.TextHintingMode="Fixed" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                          </Border>
                        </Border>
                        <Border x:Name="FocusVisualElement" BorderBrush="{Binding ActiveBorderBrush, Source={StaticResource SystemBrushes}}" BorderThickness="2" CornerRadius="0" Margin="-1" Opacity="0" IsHitTestVisible="false"/>
                      </Grid>
                    </ControlTemplate>
                  </Setter.Value>
                </Setter>
              </Style>
              <Style x:Key="CustomScrollViewerStyle" TargetType="ScrollViewer">
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="VerticalContentAlignment" Value="Top"/>
                <Setter Property="BorderThickness" Value="0,1"/>
                <Setter Property="Template">
                  <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer" >
                      <Grid>
                        <Border Margin="0,-1" Opacity="0.2" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                        <Grid>
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                          </Grid.ColumnDefinitions>
                          <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                          </Grid.RowDefinitions>
                          <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" Margin="{TemplateBinding Padding}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                          <Rectangle Fill="Transparent" Grid.Column="1" Grid.Row="1"/>
                          <ScrollBar x:Name="VerticalScrollBar" Margin="0,-1" Width="18" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" IsTabStop="False" Grid.Column="1" Grid.Row="0" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{TemplateBinding VerticalOffset}"/>
                          <ScrollBar x:Name="HorizontalScrollBar" Height="18" Margin="-1,0,-1,-1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" IsTabStop="False" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{TemplateBinding HorizontalOffset}"/>
                        </Grid>
                      </Grid>
                    </ControlTemplate>
                  </Setter.Value>
                </Setter>
              </Style>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To=".55"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ModeStates">
                <VisualState x:Name="ReadOnly"/>
                <VisualState x:Name="Empty">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="IsHitTestVisible">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation  Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Opacity" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Edit">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditButton" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="false"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CommitButton">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CancelButton">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid"/>
                <VisualState x:Name="Invalid"/>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CommittedStates">
                <VisualState x:Name="Committed"/>
                <VisualState x:Name="Uncommitted">
                  <Storyboard>
                    <DoubleAnimation  Storyboard.TargetName="ChangeIndicator" Storyboard.TargetProperty="Opacity" To="0.9"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ScopeStates">
                <VisualState x:Name="Entity"/>
                <VisualState x:Name="Collection"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="DataFormBorder" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}" BorderThickness="0" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Padding="0">
              <Grid>
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition/>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid MinHeight="27" Visibility="{TemplateBinding HeaderVisibility}" Margin="0">
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="8"/>
                  </Grid.ColumnDefinitions>
                  <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,0,0,0">
                    <ContentControl x:Name="HeaderElement" TextOptions.TextHintingMode="Fixed" Margin="8,2,0,0" VerticalAlignment="Center" FontWeight="Bold" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
                    <TextBlock x:Name="ChangeIndicator" TextOptions.TextHintingMode="Fixed" Margin="3,-2,8,2" VerticalAlignment="Center" Opacity="0" FontWeight="Bold" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Text="*" FontSize="14"/>
                  </StackPanel>
                  <StackPanel Margin="0,0,2,0" Grid.Column="2" Orientation="Horizontal">
                    <Button x:Name="FirstItemButton" Cursor="Hand" Style="{StaticResource DataFormButtonStyle}" Visibility="Collapsed" Padding="3,1">
                      <Grid Height="12" Margin="6,5,5,5" Width="12" Opacity="1">
                        <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="11" HorizontalAlignment="Right" Margin="0" Width="7" Opacity="1" Data="M1,0 L1,2 L0,1 Z"/>
                        <Rectangle Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" Height="11" Width="3" Opacity="0.85"/>
                      </Grid>
                    </Button>
                    <Button x:Name="PreviousItemButton" Cursor="Hand" Style="{StaticResource DataFormButtonStyle}" Padding="3,0">
                      <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="11" Margin="6,5,8,5" Width="7" Opacity="1" Data="M1,0 L1,2 L0,1 Z"/>
                    </Button>
                    <Button x:Name="NextItemButton" Cursor="Hand" Style="{StaticResource DataFormButtonStyle}" Padding="3,0">
                      <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="11" Margin="8,5,6,5" Width="7" Opacity="1" Data="M0,0 L1,1 L0,2 Z"/>
                    </Button>
                    <Button x:Name="LastItemButton" Cursor="Hand" Style="{StaticResource DataFormButtonStyle}" Padding="3,0">
                      <Grid Height="12" Margin="6,5,5,5" Width="12" Opacity="1">
                        <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"  Stretch="Fill" Height="11" HorizontalAlignment="Left" Width="7" Opacity="1" Data="M0,0 L1,1 L0,2 Z"/>
                        <Rectangle Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Right" Height="11" Width="3" Opacity="0.85"/>
                      </Grid>
                    </Button>
                    <Border x:Name="ButtonSeparator" Margin="2,6,5,6" Width=".5" Opacity=".2" Background="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="0"/>
                    <Button x:Name="EditButton" Cursor="Hand" Style="{StaticResource DataFormButtonStyle}" ToolTipService.ToolTip="Edit" Padding="3,0">
                      <Grid Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Width="19">
                        <Canvas HorizontalAlignment="Stretch" Margin="2,2,0,0" VerticalAlignment="Stretch">
                          <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="10.5" Width="10.56" Canvas.Left="2.53" Canvas.Top="3.01" Data="F1 M 2.53,9.96L 4.96,11.1L 6.08,13.50L 13.09,6.50L 9.6,3L 2.53,9.96 Z "/>
                          <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"  Stretch="Fill" Height="6.74" Width="6.81" Canvas.Left="7.47" Canvas.Top="1.89" Data="M1.41,1.83 L0.71,2.54 L4.20,6.03 L4.91,5.33 z M3.24,0 L6.81,3.42 L3.5,6.74 L0,3.24 z"/>
                          <Path Stretch="Fill" Stroke="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"  StrokeLineJoin="Round" Height="12.5" Width="12.43" Canvas.Left="2.03" Canvas.Top="1.50" Data="F1 M 13.77,4.22L 11.73,2.18C 11.12,1.78 10.46,2.15 10,2.5L 3.04,9.45C 2.65,9.86 2.53,10.47 2.53,10.73L 2.53,13.5L 5.32,13.5C 5.57,13.5 6.33,13.36 6.64,12.93L 13.54,6.03C 13.86,5.72 14.17,4.74 13.77,4.22 Z"/>
                          <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="2.29" Width="2.33" Canvas.Left="2.58" Canvas.Top="11.18" Data="F1 M 2.033,11.71L 4.33,14L 2.62,14C 2.17,13.93 2.09,13.79 2,13.31L 2.03,11.71 Z"/>
                        </Canvas>
                      </Grid>
                    </Button>
                    <Button x:Name="NewItemButton" Cursor="Hand" Style="{StaticResource DataFormButtonStyle}" ToolTipService.ToolTip="Add" Padding="3,0">
                      <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}"  Stretch="Fill" Height="9" HorizontalAlignment="Center" Margin="5" VerticalAlignment="Center" Width="9" Opacity="1" RenderTransformOrigin="0.5,0.5" Data="F1 M18.41,61.67 L19.56,60.52 L21.92,62.88 L24.22,60.57 L25.36,61.72 L23.06,64.03 L25.43,66.4 L24.22,67.60 L21.87,65.25 L19.56,67.56 L18.41,66.41 L20.73,64.08 L18.41,61.67 z">
                        <Path.RenderTransform>
                          <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform Angle="45"/>
                            <TranslateTransform X="0.18" Y="-0.07"/>
                          </TransformGroup>
                        </Path.RenderTransform>
                      </Path>
                    </Button>
                    <Button x:Name="DeleteItemButton" Cursor="Hand" Style="{StaticResource DataFormButtonStyle}" ToolTipService.ToolTip="Delete" Padding="3,0" Margin="0,0,-10,0">
                      <Path Fill="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}" Stretch="Fill" Height="9" HorizontalAlignment="Center" Margin="5,5,5,5" VerticalAlignment="Center" Width="9" Opacity="0.85" RenderTransformOrigin="0.5,0.5" Data="F1 M24.32,60.48 L25.60,61.76 L19.65,67.75 L18.37,66.46 z">
                        <Path.RenderTransform>
                          <TransformGroup>
                            <RotateTransform Angle="45"/>
                            <TranslateTransform X="0.06" Y="-0.01"/>
                          </TransformGroup>
                        </Path.RenderTransform>
                      </Path>
                    </Button>
                  </StackPanel>
                </Grid>
                <Border Grid.Row="1" BorderThickness="0" BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" Margin="0,0,0,-1" Canvas.ZIndex="2"/>
                <ScrollViewer Grid.Row="1" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="Auto" IsTabStop="False" Style="{StaticResource CustomScrollViewerStyle}">
                  <ContentPresenter x:Name="ContentPresenter" TextOptions.TextHintingMode="Fixed" Margin="6,10,0,6"/>
                </ScrollViewer>
                <dataInput:ValidationSummary x:Name="ValidationSummary" MaxHeight="100" BorderThickness="0" Grid.Row="2" Margin="-1,0,-1,0"/>
                <Border Grid.Row="3"/>
                <StackPanel HorizontalAlignment="Right" Grid.Row="3" Orientation="Horizontal">
                  <Button x:Name="CommitButton" Style="{StaticResource DataFormActionButtonStyle}" Margin="0,8,6,8" MinHeight="17" MinWidth="71" Visibility="Collapsed" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="OK"/>
                  <Button x:Name="CancelButton" Style="{StaticResource DataFormActionButtonStyle}" Margin="0,8,9,8" MinHeight="17" MinWidth="71" Visibility="Collapsed" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="Cancel"/>
                </StackPanel>
              </Grid>
            </Border>
            <Border x:Name="DisabledVisual" IsHitTestVisible="False" Opacity="0" Background="{Binding WindowBrush, Source={StaticResource SystemBrushes}}"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ContextMenu -->
  <Style TargetType="inputToolkit:ContextMenu">
    <Setter Property="FontFamily" Value="{StaticResource FontF_Normal}"/>
    <Setter Property="FontSize" Value="{StaticResource FontS}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="2"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:ContextMenu">
          <Border BorderBrush="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" BorderThickness="{TemplateBinding BorderThickness}" Background="{Binding ControlBrush, Source={StaticResource SystemBrushes}}">
            <Grid>
              <Rectangle Fill="{Binding ControlBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" Margin="2" RadiusY="2" RadiusX="2" Width="28"/>
              <Rectangle Fill="{Binding ControlDarkBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" Margin="30,2,0,2" Width="1"/>
              <Rectangle Fill="{Binding ControlLightLightBrush, Source={StaticResource SystemBrushes}}" HorizontalAlignment="Left" Margin="31,2,0,2" Width="1"/>
              <ItemsPresenter Margin="{TemplateBinding Padding}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- MenuItem -->
  <Style TargetType="inputToolkit:MenuItem">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Padding" Value="4,3,2,3"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="inputToolkit:MenuItem">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Presenter"/>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter">
                      <EasingDoubleKeyFrame KeyTime="0" Value=".3"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Unfocused"/>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverRectangle">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.65"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverRectangle2">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.65"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="27" Width="Auto"/>
                <ColumnDefinition Width="2"/>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Rectangle x:Name="MouseOverRectangle" IsHitTestVisible="False" Opacity="0" Fill="{Binding ActiveCaptionBrush, Source={StaticResource SystemBrushes}}"/>
              <Rectangle x:Name="MouseOverRectangle2" Grid.Column="2" IsHitTestVisible="False" Opacity="0" Fill="{Binding ActiveCaptionBrush, Source={StaticResource SystemBrushes}}"/>
            </Grid>
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="24" Width="Auto"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="17"/>
              </Grid.ColumnDefinitions>
              <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Icon}" Margin="1" VerticalAlignment="Center"/>
              <ContentControl Grid.Column="2" Foreground="{Binding ControlDarkDarkBrush, Source={StaticResource SystemBrushes}}">
                <ContentPresenter x:Name="Presenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Margin="{TemplateBinding Padding}"/>
              </ContentControl>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
